Commit e21ffabb authored by Laurent Aimar's avatar Laurent Aimar
Browse files

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

parent ba8bb2cb
...@@ -436,11 +436,12 @@ void *ToCharset(const char *charset, const char *in, size_t *outsize) ...@@ -436,11 +436,12 @@ void *ToCharset(const char *charset, const char *in, size_t *outsize)
const char *inp = in; const char *inp = in;
char *outp = res; char *outp = res;
size_t inb = inlen; size_t inb = inlen;
size_t outb = outlen; size_t outb = outlen - mul;
if (vlc_iconv (hd, &inp, &inb, &outp, &outb) != (size_t)(-1)) if (vlc_iconv (hd, &inp, &inb, &outp, &outb) != (size_t)(-1))
{ {
*outsize = outlen - outb; *outsize = outlen - outb;
outb += mul;
inb = 1; /* append nul terminator if possible */ inb = 1; /* append nul terminator if possible */
if (vlc_iconv (hd, &inp, &inb, &outp, &outb) != (size_t)(-1)) if (vlc_iconv (hd, &inp, &inb, &outp, &outb) != (size_t)(-1))
break; break;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment