summaryrefslogtreecommitdiff
path: root/junklib.c
diff options
context:
space:
mode:
Diffstat (limited to 'junklib.c')
-rw-r--r--junklib.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/junklib.c b/junklib.c
index 635a2307..e8ea3b00 100644
--- a/junklib.c
+++ b/junklib.c
@@ -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;
}
}