summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-09-21 18:29:57 +0200
committerwm4 <wm4@nowhere>2015-09-21 18:29:57 +0200
commit7850523e7ba0255fdbc9197ed0eb172df872219e (patch)
tree117d70dd5c0c39719ef0f15aa9d0b71f99539583
parent28fc8a25d1ef45166160c857bf60aff3eee6e37b (diff)
downloadlibass-no-iconv.tar.bz2
libass-no-iconv.tar.xz
don't rely on ass_utf8_put_char to 0-terminateno-iconv
There was no problem with it, but the new code is probably more intuitive.
-rw-r--r--libass/ass_utils.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libass/ass_utils.c b/libass/ass_utils.c
index c5f6e0e..29ee4c6 100644
--- a/libass/ass_utils.c
+++ b/libass/ass_utils.c
@@ -462,7 +462,6 @@ void ass_utf16be_to_utf8(char *dst, size_t dst_size, uint8_t *src, size_t src_si
if (!dst_size)
return;
- dst[0] = '\0';
while (src < end) {
uint32_t cp = ass_read_utf16be(&src, end - src);
@@ -472,6 +471,8 @@ void ass_utf16be_to_utf8(char *dst, size_t dst_size, uint8_t *src, size_t src_si
dst += s;
dst_size -= s;
}
+
+ dst[0] = '\0';
}
/**