cmark

My personal build of CMark ✏️

Commit
8e11c6d7a2f43bd507cc0349843c6fde8392eccb
Parent
0c73a05dca8afca491298f3d8f07750e3fcf330d
Author
Vicent Marti <tanoku@gmail.com>
Date

buffer: rever to using a 32-bit bufsize_t

Diffstat

2 files changed, 2 insertions, 2 deletions

Status File Name N° Changes Insertions Deletions
Modified src/buffer.c 2 1 1
Modified src/buffer.h 2 1 1
diff --git 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
@@ -13,7 +13,7 @@
 extern "C" {
 #endif
 
-typedef ssize_t bufsize_t;
+typedef int32_t bufsize_t;
 
 typedef struct {
   cmark_mem *mem;