CHARCONV: Fix handling conversion errors

Don't overwrite already converted text!
This commit is contained in:
Alexander Barton 2014-02-23 18:20:47 +01:00
parent ccc9e1baa4
commit abf280d5bd
1 changed files with 1 additions and 1 deletions

View File

@ -125,7 +125,7 @@ Convert_Message(iconv_t Handle, char *Message)
if (iconv(Handle, &Message, &in_left, &out, &out_left) == (size_t)(-1)) {
/* An error occurred! */
LogDebug("Error converting message encoding!");
strlcpy(Encoding_Buffer, Message, sizeof(Encoding_Buffer));
strlcpy(out, Message, sizeof(Encoding_Buffer));
iconv(Handle, NULL, NULL, NULL, NULL);
} else
*out = '\0';