Fix string truncation warnings (Wstringop-truncation) (#53)

This commit is contained in:
Kevin Fischer
2018-07-15 16:23:26 -05:00
committed by wyld-sw
parent ad88f94a46
commit 14855c273a
5 changed files with 16 additions and 8 deletions

View File

@@ -365,7 +365,8 @@ int save_rooms(zone_rnum rzone)
struct extra_descr_data *xdesc;
for (xdesc = room->ex_description; xdesc; xdesc = xdesc->next) {
strncpy(buf, xdesc->description, sizeof(buf));
strncpy(buf, xdesc->description, sizeof(buf) - 1);
buf[sizeof(buf) - 1] = '\0';
strip_cr(buf);
fprintf(sf, "E\n"
"%s~\n"