summaryrefslogtreecommitdiff
path: root/utf8.c
diff options
context:
space:
mode:
Diffstat (limited to 'utf8.c')
-rw-r--r--utf8.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/utf8.c b/utf8.c
index 6ddf42bf5c..a54726f14b 100644
--- a/utf8.c
+++ b/utf8.c
@@ -312,12 +312,12 @@ malformed:
if (flags & UTF8_CHECK_ONLY) {
if (retlen)
- *retlen = len;
+ *retlen = -1;
return 0;
}
if (retlen)
- *retlen = -1;
+ *retlen = expectlen ? expectlen : len;
return UNICODE_REPLACEMENT_CHARACTER;
}