diff --git a/src/cmd.c b/src/cmd.c index 17fa747fe..826c831cc 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -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) diff --git a/src/files.c b/src/files.c index f1f955bf6..63beeb586 100644 --- a/src/files.c +++ b/src/files.c @@ -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;