diff options
author | John MacFarlane <jgm@berkeley.edu> | 2015-02-02 07:40:43 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2015-02-02 07:40:43 -0800 |
commit | c698cdcbd2e61f91059479bc18c8f3ca4da62fb7 (patch) | |
tree | 7237e969b252f233e069a2e00c3064929dbebf99 /src/houdini_html_u.c | |
parent | 57a756462f30d7f2f03c8d8de9ea874cf9536fa9 (diff) | |
parent | cd9a269bbda29a26a9bf6b8b47bd12dec64e3df2 (diff) |
Merge pull request #5 from nwellnhof/zap_strnlen
Don't rely on strnlen being available
Diffstat (limited to 'src/houdini_html_u.c')
-rw-r--r-- | src/houdini_html_u.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/houdini_html_u.c b/src/houdini_html_u.c index ecd7faa..2cb14b4 100644 --- a/src/houdini_html_u.c +++ b/src/houdini_html_u.c @@ -55,7 +55,10 @@ houdini_unescape_ent(cmark_strbuf *ob, const uint8_t *src, size_t size) const struct html_ent *entity = find_entity((char *)src, i); if (entity != NULL) { - size_t len = strnlen((const char *)entity->utf8, 4); + int len = 0; + while (len < 4 && entity->utf8[len] != '\0') { + ++len; + } cmark_strbuf_put(ob, entity->utf8, len); return i + 1; } |