summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVicent Marti <tanoku@gmail.com>2016-05-30 15:54:13 +0200
committerJohn MacFarlane <jgm@berkeley.edu>2016-06-06 15:39:05 -0700
commit8e11c6d7a2f43bd507cc0349843c6fde8392eccb (patch)
treee6b891044d221ff8fbf10039656be505a15f3ff2
parent0c73a05dca8afca491298f3d8f07750e3fcf330d (diff)
buffer: rever to using a 32-bit bufsize_t
-rw-r--r--src/buffer.c2
-rw-r--r--src/buffer.h2
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;