File 191.patch of Package transfig.38710
commit 5f22009dba73922e98d49c0096cece8b215cd45b
Author: Thomas Loimer <thomas.loimer@tuwien.ac.at>
Date: Tue Apr 8 21:34:23 2025 +0200
Permit \0 in the second line in the fig file, #191
---
fig2dev/read.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- fig2dev/read.c
+++ fig2dev/read.c 2025-05-16 09:13:21.182756704 +0000
@@ -181,7 +181,8 @@ read_objects(FILE *fp, F_compound *obj)
}
/* check for embedded '\0' */
- if (strlen(buf) < sizeof buf - 1 && buf[strlen(buf) - 1] != '\n') {
+ if (*buf == '\0' || (strlen(buf) < sizeof buf - 1 &&
+ buf[strlen(buf) - 1] != '\n')) {
put_msg("ASCII NUL ('\\0') character within the first line.");
exit(EXIT_FAILURE);
/* seek to the end of the first line