Skip to content

Commit

Permalink
Fix: attempt to silence some warnings in cmd.c and files.c
Browse files Browse the repository at this point in the history
  • Loading branch information
k21971 committed Oct 14, 2024
1 parent 2a5fdb4 commit b27e79e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 1 addition & 3 deletions src/cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -2799,9 +2799,7 @@ int final;
you_are("clairvoyant", from_what(CLAIRVOYANT));
else if ((HClairvoyant || EClairvoyant) && BClairvoyant) {
Strcpy(buf, from_what(-CLAIRVOYANT));
if (!strncmp(buf, " because of ", 12))
/* overwrite substring; strncpy doesn't add terminator */
(void) strncpy(buf, " if not for ", 12);
(void) strsubst(buf, " because of ", " if not for ");
enl_msg(You_, "could be", "could have been", " clairvoyant", buf);
}
if (Infravision)
Expand Down
4 changes: 2 additions & 2 deletions src/files.c
Original file line number Diff line number Diff line change
Expand Up @@ -4918,13 +4918,13 @@ short *rcode;
while (fscanf(f,"%s",buf) == 1) {
if (sscanf(buf, "otyp=%hd", &(o->otyp)) == 1)
continue;
if (sscanf(buf, "owt=%d", &(o->owt)) == 1)
if (sscanf(buf, "owt=%u", &(o->owt)) == 1)
continue;
if (sscanf(buf, "quan=%ld", &(o->quan)) == 1)
continue;
if (sscanf(buf, "spe=%hhd", &(o->spe)) == 1)
continue;
if (sscanf(buf, "oclass=%hhd", &(o->oclass)) == 1)
if (sscanf(buf, "oclass=%c", &(o->oclass)) == 1)
continue;
if (sscanf(buf, "cursed=%d", &tmp_bitfield) == 1) {
o->cursed = tmp_bitfield;
Expand Down

0 comments on commit b27e79e

Please sign in to comment.