diff --git a/usr.bin/jot/jot.c b/usr.bin/jot/jot.c index 34ec76b55f4f..088903f86674 100644 --- a/usr.bin/jot/jot.c +++ b/usr.bin/jot/jot.c @@ -480,7 +480,9 @@ getformat(void) else if (*p == '%' && *(p+1) == '%') p++; else if (*p == '%' && !*(p+1)) { - strcat(format, "%"); + if (strlcat(format, "%", sizeof(format)) >= + sizeof(format)) + errx(1, "-w word too long"); break; } }