enforce null termination of read string

This commit is contained in:
Axel Kohlmeyer
2022-08-05 04:24:08 -04:00
parent f448fd4191
commit a9829b1e5f

View File

@ -52,6 +52,7 @@ int main(int argc, char **argv)
printf("Error reading binary STL header: %s\n", strerror(errno));
return 4;
}
title[79] = '\0'; // ensure null termination of title string
count = strlen(title);
if (count == 0) snprintf(title, 80, "STL object from file %s", argv[1]);