]> gitweb.ps.run Git - ps-cgit/blobdiff - html.c
html: fix handling of null byte
[ps-cgit] / html.c
diff --git a/html.c b/html.c
index 7f81965fddcd837cc880f3a28b120d9fe71b504c..0bac34bcf82b3a31ad3dda25f7c7bcee3d9d8f3a 100644 (file)
--- a/html.c
+++ b/html.c
@@ -59,7 +59,7 @@ char *fmt(const char *format, ...)
        va_start(args, format);
        len = vsnprintf(buf[bufidx], sizeof(buf[bufidx]), format, args);
        va_end(args);
-       if (len > sizeof(buf[bufidx])) {
+       if (len >= sizeof(buf[bufidx])) {
                fprintf(stderr, "[html.c] string truncated: %s\n", format);
                exit(1);
        }