summaryrefslogtreecommitdiff
path: root/src/buffer.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/buffer.h')
-rw-r--r--src/buffer.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/buffer.h b/src/buffer.h
index f9696e0..babd051 100644
--- a/src/buffer.h
+++ b/src/buffer.h
@@ -3,6 +3,7 @@
#include <stddef.h>
#include <stdarg.h>
+#include <string.h>
#include <limits.h>
#include "config.h"
@@ -82,6 +83,11 @@ cmark_strbuf_check_bufsize(size_t size) {
return (bufsize_t)size;
}
+static inline bufsize_t
+cmark_strbuf_safe_strlen(const char *str) {
+ return cmark_strbuf_check_bufsize(strlen(str));
+}
+
#ifdef __cplusplus
}
#endif