mirror of
				https://github.com/osmarks/ngircd.git
				synced 2025-10-31 05:52:59 +00:00 
			
		
		
		
	CHARCONV: Fix handling conversion errors
Don't overwrite already converted text!
(cherry picked from commit abf280d5bd)
			
			
This commit is contained in:
		| @@ -125,7 +125,7 @@ Convert_Message(iconv_t Handle, char *Message) | |||||||
| 	if (iconv(Handle, &Message, &in_left, &out, &out_left) == (size_t)(-1)) { | 	if (iconv(Handle, &Message, &in_left, &out, &out_left) == (size_t)(-1)) { | ||||||
| 		/* An error occurred! */ | 		/* An error occurred! */ | ||||||
| 		LogDebug("Error converting message encoding!"); | 		LogDebug("Error converting message encoding!"); | ||||||
| 		strlcpy(Encoding_Buffer, Message, sizeof(Encoding_Buffer)); | 		strlcpy(out, Message, sizeof(Encoding_Buffer)); | ||||||
| 		iconv(Handle, NULL, NULL, NULL, NULL); | 		iconv(Handle, NULL, NULL, NULL, NULL); | ||||||
| 	} else | 	} else | ||||||
| 		*out = '\0'; | 		*out = '\0'; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Alexander Barton
					Alexander Barton