From 2281a33fd916ee512272e658020b97ca6cccfa7d Mon Sep 17 00:00:00 2001
From: magnum <magnum>
Date: Mon, 3 Oct 2011 18:24:54 +0200
Subject: [PATCH] j7: Fix for AlwaysReportUTF8 vs. very long input

---
 src/unicode.c |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/unicode.c b/src/unicode.c
index 32fef1b..dea059c 100644
--- a/src/unicode.c
+++ b/src/unicode.c
@@ -713,20 +713,20 @@ UTF8 *utf16_to_utf8_r (UTF8 *dst, int dst_len, const UTF16 *source) {
 /* Thread-safe conversion from codepage to UTF-8 */
 UTF8 *enc_to_utf8_r (char *src, UTF8 *dst)
 {
-	UTF16 tmp16[PLAINTEXT_BUFFER_SIZE + 1];
-	enc_to_utf16(tmp16, PLAINTEXT_BUFFER_SIZE, (unsigned char*)src,
-	             PLAINTEXT_BUFFER_SIZE);
-	dst = utf16_to_utf8_r(dst, PLAINTEXT_BUFFER_SIZE, tmp16);
+	UTF16 tmp16[LINE_BUFFER_SIZE + 1];
+	enc_to_utf16(tmp16, LINE_BUFFER_SIZE, (unsigned char*)src,
+	             LINE_BUFFER_SIZE);
+	dst = utf16_to_utf8_r(dst, LINE_BUFFER_SIZE, tmp16);
 	return dst;
 }
 
 /* Thread-safe conversion from UTF-8 to codepage */
 char * utf8_to_enc_r (UTF8 *src, char* dst)
 {
-	UTF16 tmp16[PLAINTEXT_BUFFER_SIZE + 1];
-	utf8_to_utf16(tmp16, PLAINTEXT_BUFFER_SIZE, (unsigned char*)src,
-	              PLAINTEXT_BUFFER_SIZE);
-	dst = (char*)utf16_to_enc_r((UTF8*)dst, PLAINTEXT_BUFFER_SIZE, tmp16);
+	UTF16 tmp16[LINE_BUFFER_SIZE + 1];
+	utf8_to_utf16(tmp16, LINE_BUFFER_SIZE, (unsigned char*)src,
+	              LINE_BUFFER_SIZE);
+	dst = (char*)utf16_to_enc_r((UTF8*)dst, LINE_BUFFER_SIZE, tmp16);
 	return dst;
 }
 
-- 
1.7.4.1

