summaryrefslogtreecommitdiff
path: root/xs_unicode.h
diff options
context:
space:
mode:
authorGravatar grunfink2025-08-23 20:41:16 +0200
committerGravatar grunfink2025-08-23 20:41:16 +0200
commit75cc7ae7a3799a27a5647a2c7d912e6a6e2fbb5b (patch)
treee8988779f9a6ac8d93695ad0e6adbf7b2c3aac29 /xs_unicode.h
parentEnsure the tag is a string in server_get_handler(). (diff)
downloadsnac2-75cc7ae7a3799a27a5647a2c7d912e6a6e2fbb5b.tar.gz
snac2-75cc7ae7a3799a27a5647a2c7d912e6a6e2fbb5b.tar.xz
snac2-75cc7ae7a3799a27a5647a2c7d912e6a6e2fbb5b.zip
Added some more helping functions.
Diffstat (limited to 'xs_unicode.h')
-rw-r--r--xs_unicode.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/xs_unicode.h b/xs_unicode.h
index ef18fea..67b3827 100644
--- a/xs_unicode.h
+++ b/xs_unicode.h
@@ -79,6 +79,10 @@ unsigned int xs_utf8_dec(const char **str)
79/* decodes an utf-8 char inside str and updates the pointer */ 79/* decodes an utf-8 char inside str and updates the pointer */
80{ 80{
81 const char *p = *str; 81 const char *p = *str;
82
83 if (!xs_is_string(p))
84 return 0;
85
82 unsigned int cpoint = 0; 86 unsigned int cpoint = 0;
83 unsigned char c = *p++; 87 unsigned char c = *p++;
84 int cb = 0; 88 int cb = 0;