Revision: 1085
http://vcs.pcre.org/viewvc?view=rev&revision=1085
Author: chpe
Date: 2012-10-16 16:55:32 +0100 (Tue, 16 Oct 2012)
Log Message:
-----------
pcre32: pcretest: Fix pchar for 32-bit
Modified Paths:
--------------
code/trunk/pcretest.c
Modified: code/trunk/pcretest.c
===================================================================
--- code/trunk/pcretest.c 2012-10-16 15:55:28 UTC (rev 1084)
+++ code/trunk/pcretest.c 2012-10-16 15:55:32 UTC (rev 1085)
@@ -1731,6 +1731,7 @@
static int pchar(pcre_uint32 c, FILE *f)
{
+int n;
if (PRINTOK(c))
{
if (f != NULL) fprintf(f, "%c", c);
@@ -1751,11 +1752,8 @@
}
}
-if (f != NULL) fprintf(f, "\\x{%02x}", c);
-return (c <= 0x000000ff)? 6 :
- (c <= 0x00000fff)? 7 :
- (c <= 0x0000ffff)? 8 :
- (c <= 0x000fffff)? 9 : 10;
+if (f != NULL) n = fprintf(f, "\\x{%02x}", c);
+return n >= 0 ? n : 0;
}