]> granicus.if.org Git - postgresql/commitdiff
Fix encoding conversion function bug.
authorTatsuo Ishii <ishii@postgresql.org>
Sat, 12 Apr 2003 07:53:57 +0000 (07:53 +0000)
committerTatsuo Ishii <ishii@postgresql.org>
Sat, 12 Apr 2003 07:53:57 +0000 (07:53 +0000)
See following posting for more details.

Subject: Re: [HACKERS] [BUGS] Bug #943: Server-Encoding from EUC_TW to UTF-8 doesn't
From: Tatsuo Ishii <t-ishii@sra.co.jp>
To: michael.enke@wincor-nixdorf.com, pgsql-bugs@postgresql.org
Cc: pgsql-hackers@postgresql.org
Date: Sat, 12 Apr 2003 10:51:45 +0900 (JST)

src/backend/utils/mb/conv.c

index 0337692d88cfb207aaeed8d3746e6423bc295c00..2586365f3bc965a8ead98353e6a58e8bff6ccde4 100644 (file)
@@ -6,7 +6,7 @@
  * Portions Copyright (c) 1994, Regents of the University of California
  *
  * IDENTIFICATION
- *       $Header: /cvsroot/pgsql/src/backend/utils/mb/conv.c,v 1.44 2003/03/10 22:28:18 tgl Exp $
+ *       $Header: /cvsroot/pgsql/src/backend/utils/mb/conv.c,v 1.45 2003/04/12 07:53:57 ishii Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -313,7 +313,7 @@ compare1(const void *p1, const void *p2)
 
        v1 = *(unsigned int *) p1;
        v2 = ((pg_utf_to_local *) p2)->utf;
-       return (v1 - v2);
+       return (v1 > v2)?1:((v1 == v2)?0:-1);
 }
 
 /*
@@ -328,7 +328,7 @@ compare2(const void *p1, const void *p2)
 
        v1 = *(unsigned int *) p1;
        v2 = ((pg_local_to_utf *) p2)->code;
-       return (v1 - v2);
+       return (v1 > v2)?1:((v1 == v2)?0:-1);
 }
 
 /*