diff options
-rw-r--r-- | src/buffer.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/buffer.c b/src/buffer.c index db575ed..08192da 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -192,8 +192,7 @@ void cmark_strbuf_vprintf(cmark_strbuf *buf, const char *format, va_list ap) abort(); } - // TODO: Check for overflow. - if (len + 1 <= buf->asize - buf->size) { + if ((size_t)len < (size_t)(buf->asize - buf->size)) { buf->size += len; break; } |