Fix off-by-one error

This commit is contained in:
Lassi Kortela 2019-08-23 00:40:41 +03:00
parent 9d4bf19367
commit 2b9e15920b
1 changed files with 1 additions and 1 deletions

View File

@ -1014,7 +1014,7 @@ int ios_printf(struct ios *s, const char *format, ...)
if (len < 0) { if (len < 0) {
len = 0; len = 0;
} }
if (len > (int)sizeof(purkka)) { if (len >= (int)sizeof(purkka)) {
lerror(MemoryError, "out of memory in ios_printf buffer"); lerror(MemoryError, "out of memory in ios_printf buffer");
} }
ios_write(s, purkka, len); ios_write(s, purkka, len);