Added warning for string truncation

This commit is contained in:
Stefan authored and GitHub committed 2026-05-15 01:24:02 +02:00
1 parent 7ff3dfdabf
commit 0eb3fed6df
1 file changed
+1
+1
View File
@@ -261,6 +261,7 @@ static char *nextWord (void)
static void setLen (char *name, unsigned len)
{
if (strlen (name) > len) {
fprintf (stderr, "Warning: string truncated to %u characters\n", len);
name[len] = '\0';
}
}