commit 1d3137ff69750eb96138cb2799db098c4d8a67b7 from: Alexander Barton date: Wed Mar 19 01:28:08 2014 UTC CHARCONV: Fix handling conversion errors Don't overwrite already converted text! (cherry picked from commit abf280d5bd5648817135c487a19941b2ef4b0701) commit - d20de381617d17bc718397d7b34d2c2d8df4c7ad commit + 1d3137ff69750eb96138cb2799db098c4d8a67b7 blob - 98cd29a367047323d1633f57f2473443075215d9 blob + d0c56306698bbe599900073690a127e4e06c8a3a --- src/ngircd/conn-encoding.c +++ src/ngircd/conn-encoding.c @@ -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';