summaryrefslogtreecommitdiff
path: root/src/utf8.c
diff options
context:
space:
mode:
authorVicent Marti <tanoku@gmail.com>2014-09-02 13:37:34 +0200
committerVicent Marti <tanoku@gmail.com>2014-09-09 03:39:15 +0200
commitc28af79329264a7cf331a1b1c414919e4ed9e9f9 (patch)
tree086b28822b457bde4c525f4b86a42618c030dfc6 /src/utf8.c
parent24248c0f1a6de6f229890c5c03aeff8738214fee (diff)
It buiiiilds
Diffstat (limited to 'src/utf8.c')
-rw-r--r--src/utf8.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/utf8.c b/src/utf8.c
index e3f8dd3..32c78a4 100644
--- a/src/utf8.c
+++ b/src/utf8.c
@@ -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;