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:
13
src/trap.c
13
src/trap.c
@@ -4838,11 +4838,14 @@ boolean force;
|
||||
trap_skipped = TRUE;
|
||||
deal_with_floor_trap = FALSE;
|
||||
} else {
|
||||
Sprintf(
|
||||
qbuf, "There %s and %s here. %s %s?",
|
||||
(boxcnt == 1) ? "is a container" : "are containers",
|
||||
an(trapdescr),
|
||||
(ttmp->ttyp == WEB) ? "Remove" : "Disarm", the_trap);
|
||||
Snprintf(qbuf, sizeof(qbuf),
|
||||
"There %s and %s here. %s %s?",
|
||||
(boxcnt == 1) ? "is a container"
|
||||
: "are containers",
|
||||
an(trapdescr),
|
||||
(ttmp->ttyp == WEB) ? "Remove"
|
||||
: "Disarm",
|
||||
the_trap);
|
||||
switch (ynq(qbuf)) {
|
||||
case 'q':
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user