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);
+ /* overwrite substring */
+ memcpy(buf, " if not for ", 12);
enl_msg(You_, "could be", "could have been", " clairvoyant", buf);
}
if (Infravision)
(note: strncpy() only terminates output string if the specified
count is bigger than the length of the substring being copied) */
if (!strncmp(dbase_str, "moist towel", 11))
- (void) strncpy(dbase_str += 2, "wet", 3); /* skip "mo" replace "ist" */
+ memcpy(dbase_str += 2, "wet", 3); /* skip "mo" replace "ist" */
/* Make sure the name is non-empty. */
if (*dbase_str) {
/* truncate, preserving the final 3 characters:
"___ extremely long text" -> "___ extremely l...ext"
(this may be suboptimal if overflow is less than 3) */
- (void) strncpy(pbuf + BUFSZ - 1 - 6, "...", 3);
+ memcpy(pbuf + BUFSZ - 1 - 6, "...", 3);
/* avoid strncpy; buffers could overlap if excess is small */
pbuf[BUFSZ - 1 - 3] = line[ln - 3];
pbuf[BUFSZ - 1 - 2] = line[ln - 2];
nm += 3;
if ((bp = strstri(nm, " armour")) != 0) {
- (void) strncpy(bp, " armor ", 7); /* won't add '\0' */
+ memcpy(bp, " armor ", 7);
(void) mungspaces(bp + 1); /* remove the extra space */
}