diff options
author | waker <wakeroid@gmail.com> | 2011-02-07 22:20:35 +0100 |
---|---|---|
committer | waker <wakeroid@gmail.com> | 2011-02-07 22:20:35 +0100 |
commit | 38e883f1fbc97fc33a01af93cd0a82f971390b51 (patch) | |
tree | 5ee065eb2a69f4d19473a49de605bb5c4d4460dd /junklib.c | |
parent | 083e9b711cdd5f255e09dfb040a9fd93e97c1774 (diff) |
fixed junklib utf8 validation
Diffstat (limited to 'junklib.c')
-rw-r--r-- | junklib.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -320,10 +320,10 @@ int ddb_iconv (const char *cs_out, const char *cs_in, char *out, int outlen, con // to utf8 branch if (!strcmp (cs_out, UTF8_STR)) { if (!strcmp (cs_in, UTF8_STR)) { - int valid = u8_valid (in, inlen, NULL); + memcpy (out, in, inlen); + out[inlen] = 0; + int valid = u8_valid (out, inlen, NULL); if (valid) { - memcpy (out, in, inlen); - out[inlen] = 0; len = inlen; } } |