mirror of
https://git.zx2c4.com/cgit
synced 2024-12-21 14:41:53 +00:00
html: fix handling of null byte
A return value of `len` or more means that the output was truncated. Signed-off-by: Peter Prohaska <pitrp@web.de> Signed-off-by: Christian Hesse <mail@eworm.de>
This commit is contained in:
parent
4e4b30effb
commit
ce2062d9e2
2
html.c
2
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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user