From 8e11c6d7a2f43bd507cc0349843c6fde8392eccb Mon Sep 17 00:00:00 2001 From: Vicent Marti Date: Mon, 30 May 2016 15:54:13 +0200 Subject: buffer: rever to using a 32-bit bufsize_t --- src/buffer.c | 2 +- src/buffer.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/buffer.c b/src/buffer.c index b879f0c..12cbc56 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -41,7 +41,7 @@ void cmark_strbuf_grow(cmark_strbuf *buf, bufsize_t target_size) { if (target_size < buf->asize) return; - if (target_size > (bufsize_t)(SIZE_MAX / 4)) + if (target_size > (bufsize_t)(INT32_MAX / 2)) abort(); /* Oversize the buffer by 50% to guarantee amortized linear time diff --git a/src/buffer.h b/src/buffer.h index 96b2704..2d3db0d 100644 --- a/src/buffer.h +++ b/src/buffer.h @@ -13,7 +13,7 @@ extern "C" { #endif -typedef ssize_t bufsize_t; +typedef int32_t bufsize_t; typedef struct { cmark_mem *mem; -- cgit v1.2.3