dtsr: Coverity fixes for string buffer issues

This commit is contained in:
Peter Howkins
2018-04-24 03:03:06 +01:00
parent 3cf92f3741
commit a1fb026d86
5 changed files with 6 additions and 6 deletions

View File

@@ -387,11 +387,11 @@ static char *char_label (int x)
if (x > 256)
return "";
else if (x < 32) {
sprintf (buf, "'CTRL-%c'", 0x40 | x);
snprintf(buf, sizeof(buf), "'CTRL-%c'", 0x40 | x);
return buf;
}
else if (x >= 128) {
strcpy (buf, catgets(dtsearch_catd, MS_huff, 32,
snprintf(buf, sizeof(buf), "%s", catgets(dtsearch_catd, MS_huff, 32,
"(nonascii char, high bit set)"));
return buf;
}