X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/b7e1a1d30fd5478456f2a19f0fbb7bc1e6388109..b4f2851d:/sbr/fmt_scan.c?ds=inline diff --git a/sbr/fmt_scan.c b/sbr/fmt_scan.c index 4460c628..fe2a0044 100644 --- a/sbr/fmt_scan.c +++ b/sbr/fmt_scan.c @@ -1079,7 +1079,7 @@ fmt_scan (struct format *format, char *scanl, size_t max, int width, int *dat, there isn't enough room in the buffer for the entire string, skip it completely. Need room for null terminator, and maybe trailing newline (added below). */ - if (cp - scanl + strlen (str) + 1 < max) { + if (str && (cp - scanl + strlen (str) + 1 < max)) { for (sp = str; *sp; *cp++ = *sp++) continue; } if (callbacks && callbacks->trace_func)