diff options
Diffstat (limited to 'iconvdata/gb2312.h')
-rw-r--r-- | iconvdata/gb2312.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/iconvdata/gb2312.h b/iconvdata/gb2312.h index 3de274e..cde9375 100644 --- a/iconvdata/gb2312.h +++ b/iconvdata/gb2312.h @@ -23,6 +23,7 @@ #include <gconv.h> #include <stdint.h> +#include <assert.h> /* Conversion table. */ extern const uint16_t __gb2312_to_ucs[]; @@ -66,7 +67,7 @@ extern const char __gb2312_from_ucs4_tab8[][2]; extern const char __gb2312_from_ucs4_tab9[][2]; static inline size_t -ucs4_to_gb2312 (uint32_t wch, unsigned char **s, size_t avail) +ucs4_to_gb2312 (uint32_t wch, unsigned char *s, size_t avail) { unsigned int ch = (unsigned int) wch; char buf[2]; @@ -220,8 +221,8 @@ ucs4_to_gb2312 (uint32_t wch, unsigned char **s, size_t avail) if (avail < 2) return 0; - *(*s)++ = cp[0]; - *(*s)++ = cp[1]; + s[0] = cp[0]; + s[1] = cp[1]; return 2; } |