diff options
author | Vicent Marti <tanoku@gmail.com> | 2014-09-02 13:37:34 +0200 |
---|---|---|
committer | Vicent Marti <tanoku@gmail.com> | 2014-09-09 03:39:15 +0200 |
commit | c28af79329264a7cf331a1b1c414919e4ed9e9f9 (patch) | |
tree | 086b28822b457bde4c525f4b86a42618c030dfc6 /src/utf8.c | |
parent | 24248c0f1a6de6f229890c5c03aeff8738214fee (diff) |
It buiiiilds
Diffstat (limited to 'src/utf8.c')
-rw-r--r-- | src/utf8.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -1,6 +1,7 @@ #include <stdlib.h> #include <stdint.h> #include <unistd.h> +#include <assert.h> #include "stmd.h" @@ -83,9 +84,9 @@ ssize_t utf8proc_iterate(const uint8_t *str, ssize_t str_len, int32_t *dst) return length; } -void utf8_encode_char(int32_t uc, gh_buf *buf) +void utf8proc_encode_char(int32_t uc, gh_buf *buf) { - char dst[4]; + unsigned char dst[4]; int len = 0; if (uc < 0x00) { @@ -99,7 +100,7 @@ void utf8_encode_char(int32_t uc, gh_buf *buf) len = 2; } else if (uc == 0xFFFF) { dst[0] = 0xFF; - return 1; + len = 1; } else if (uc == 0xFFFE) { dst[0] = 0xFE; len = 1; |