summaryrefslogtreecommitdiff
path: root/src/houdini_html_u.c
diff options
context:
space:
mode:
authorNick Wellnhofer <wellnhofer@aevum.de>2015-06-07 16:52:44 +0200
committerNick Wellnhofer <wellnhofer@aevum.de>2015-06-07 21:42:15 +0200
commit7382fd5eba48107a8190bd2d6232cc3b6e20d8fc (patch)
treeb0d3c9f7b9a2f2eb94c0806c32e9d77f4ba59149 /src/houdini_html_u.c
parentd49d3fd7bab4a8734e5f22318e3fb538bfe20dbb (diff)
Convert code base to strbuf_t
There are probably a couple of places I missed. But this will only be a problem if we use a 64-bit bufsize_t at some point. Then, we'll get warnings from -Wshorten-64-to-32.
Diffstat (limited to 'src/houdini_html_u.c')
-rw-r--r--src/houdini_html_u.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/houdini_html_u.c b/src/houdini_html_u.c
index eaf295e..e57894d 100644
--- a/src/houdini_html_u.c
+++ b/src/houdini_html_u.c
@@ -7,10 +7,10 @@
#include "utf8.h"
#include "html_unescape.h"
-size_t
-houdini_unescape_ent(cmark_strbuf *ob, const uint8_t *src, size_t size)
+bufsize_t
+houdini_unescape_ent(cmark_strbuf *ob, const uint8_t *src, bufsize_t size)
{
- size_t i = 0;
+ bufsize_t i = 0;
if (size >= 3 && src[0] == '#') {
int codepoint = 0;
@@ -68,7 +68,7 @@ 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) {
- int len = 0;
+ bufsize_t len = 0;
while (len < 4 && entity->utf8[len] != '\0') {
++len;
}
@@ -85,9 +85,9 @@ houdini_unescape_ent(cmark_strbuf *ob, const uint8_t *src, size_t size)
}
int
-houdini_unescape_html(cmark_strbuf *ob, const uint8_t *src, size_t size)
+houdini_unescape_html(cmark_strbuf *ob, const uint8_t *src, bufsize_t size)
{
- size_t i = 0, org, ent;
+ bufsize_t i = 0, org, ent;
while (i < size) {
org = i;
@@ -122,7 +122,7 @@ houdini_unescape_html(cmark_strbuf *ob, const uint8_t *src, size_t size)
return 1;
}
-void houdini_unescape_html_f(cmark_strbuf *ob, const uint8_t *src, size_t size)
+void houdini_unescape_html_f(cmark_strbuf *ob, const uint8_t *src, bufsize_t size)
{
if (!houdini_unescape_html(ob, src, size))
cmark_strbuf_put(ob, src, size);