summaryrefslogtreecommitdiff
path: root/include/mupdf/fitz/string-util.h
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2018-05-21 11:09:17 +0200
committerTor Andersson <tor.andersson@artifex.com>2018-06-02 02:08:17 +0200
commit928b43eab613970ebe6448b294bba866d43d12bd (patch)
tree45febe0455ee90abeb1398c62e7e68c85e050209 /include/mupdf/fitz/string-util.h
parent4d473e7f6a6ec72265270c03a26b48e27db11282 (diff)
downloadmupdf-928b43eab613970ebe6448b294bba866d43d12bd.tar.xz
Add a fz_strnlen function (strnlen is not standard C).
Diffstat (limited to 'include/mupdf/fitz/string-util.h')
-rw-r--r--include/mupdf/fitz/string-util.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/mupdf/fitz/string-util.h b/include/mupdf/fitz/string-util.h
index fdf47c86..2bfc728f 100644
--- a/include/mupdf/fitz/string-util.h
+++ b/include/mupdf/fitz/string-util.h
@@ -11,6 +11,12 @@
*/
/*
+ fz_strnlen: Return strlen(s), if that is less than maxlen, or maxlen if
+ there is no null byte ('\0') among the first maxlen bytes.
+*/
+size_t fz_strnlen(const char *s, size_t maxlen);
+
+/*
fz_strsep: Given a pointer to a C string (or a pointer to NULL) break
it at the first occurrence of a delimiter char (from a given set).