[vlc-commits] commit: Fixed a bug in ToCharset I introduced by fixing another one... ( Laurent Aimar )

git at videolan.org git at videolan.org
Wed Nov 3 23:41:41 CET 2010


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Wed Nov  3 23:40:41 2010 +0100| [e21ffabb47f4040f16a584eafcc78cb8681864a2] | committer: Laurent Aimar 

Fixed a bug in ToCharset I introduced by fixing another one...

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e21ffabb47f4040f16a584eafcc78cb8681864a2
---

 src/text/unicode.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/text/unicode.c b/src/text/unicode.c
index bad916c..a8e58a5 100644
--- a/src/text/unicode.c
+++ b/src/text/unicode.c
@@ -436,11 +436,12 @@ void *ToCharset(const char *charset, const char *in, size_t *outsize)
         const char *inp = in;
         char *outp = res;
         size_t inb = inlen;
-        size_t outb = outlen;
+        size_t outb = outlen - mul;
 
         if (vlc_iconv (hd, &inp, &inb, &outp, &outb) != (size_t)(-1))
         {
             *outsize = outlen - outb;
+            outb += mul;
             inb = 1; /* append nul terminator if possible */
             if (vlc_iconv (hd, &inp, &inb, &outp, &outb) != (size_t)(-1))
                 break;



More information about the vlc-commits mailing list