Fix gcc sprintf warnings
Gcc 9 has become more vocal with sprintf buffer overflow checking. Remove these sprintf warnings by changing the offending calls to a snprintf wrapper that will explicitly check the result.
This commit is contained in:
@@ -715,7 +715,8 @@ int *spell_no;
|
||||
Sprintf(lets, "a-zA-%c", 'A' + nspells - 27);
|
||||
|
||||
for (;;) {
|
||||
Sprintf(qbuf, "Cast which spell? [%s *?]", lets);
|
||||
Snprintf(qbuf, sizeof(qbuf), "Cast which spell? [%s *?]",
|
||||
lets);
|
||||
ilet = yn_function(qbuf, (char *) 0, '\0');
|
||||
if (ilet == '*' || ilet == '?')
|
||||
break; /* use menu mode */
|
||||
|
||||
Reference in New Issue
Block a user