ngircd

Free, portable and lightweight Internet Relay Chat server http://ngircd.barton.de/
Log | Files | Refs | README | LICENSE

commit abf280d5bd5648817135c487a19941b2ef4b0701
parent ccc9e1baa41c2b81d641d87acaefbf07eb499ad4
Author: Alexander Barton <alex@barton.de>
Date:   Sun, 23 Feb 2014 18:20:47 +0100

CHARCONV: Fix handling conversion errors

Don't overwrite already converted text!

Diffstat:
Msrc/ngircd/conn-encoding.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/ngircd/conn-encoding.c b/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';