Revert "When LF->CR+LF conversion causes an buffer truncation, supress the conversion...
authorHiroshi Inoue <inoue@tpf.co.jp>
Wed, 19 Feb 2014 12:50:41 +0000 (21:50 +0900)
committerHiroshi Inoue <inoue@tpf.co.jp>
Wed, 19 Feb 2014 12:50:41 +0000 (21:50 +0900)
This reverts commit 3666c87c1440862bde2e6b8f43ee585deed70d31.

win_unicode.c

index 145a332746e25ee0d205d4c6fe2e88ad0eeb6fac..21cf6f914a6bb231fd66ec52dba74b10305cb1a8 100644 (file)
@@ -167,7 +167,7 @@ char *ucs2_to_utf8(const SQLWCHAR *ucs2str, SQLLEN ilen, SQLLEN *olen, BOOL lowe
 #define def_utf2ucs(errcheck) \
 SQLULEN    utf8_to_ucs2_lf##errcheck(const char *utf8str, SQLLEN ilen, BOOL lfconv, SQLWCHAR *ucs2str, SQLULEN bufcount) \
 { \
-   int i, lfcount = 0; \
+   int i; \
    SQLULEN rtn, ocount, wcode; \
    const UCHAR *str; \
 \
@@ -197,7 +197,6 @@ SQLULEN utf8_to_ucs2_lf##errcheck(const char *utf8str, SQLLEN ilen, BOOL lfconv,
                if (ocount < bufcount) \
                    ucs2str[ocount] = PG_CARRIAGE_RETURN; \
                ocount++; \
-               lfcount++; \
            } \
            if (ocount < bufcount) \
                ucs2str[ocount] = *str; \
@@ -302,8 +301,6 @@ cleanup: \
            rtn = 0; \
        ocount = 0; \
    } \
-   if (ocount >= bufcount && ocount < bufcount + lfcount) \
-       return utf8_to_ucs2_lf##errcheck(utf8str, ilen, FALSE, ucs2str, bufcount); \
    if (ocount < bufcount && ucs2str) \
        ucs2str[ocount] = 0; \
 /*mylog(" ocount=%d\n", ocount);*/ \