summaryrefslogtreecommitdiff
path: root/pcretest.c
diff options
context:
space:
mode:
authorchpe <chpe@2f5784b3-3f2a-0410-8824-cb99058d5e15>2012-10-16 15:55:32 +0000
committerchpe <chpe@2f5784b3-3f2a-0410-8824-cb99058d5e15>2012-10-16 15:55:32 +0000
commit158bb85c58416be13de92458f5ebcc7edaeb29bc (patch)
tree306ba9a6cce8446189bfc768247632de51002ea6 /pcretest.c
parentc22fe66207feb20b65a935673ccd1a466a7a9f99 (diff)
downloadpcre-158bb85c58416be13de92458f5ebcc7edaeb29bc.tar.gz
pcre32: pcretest: Fix pchar for 32-bit
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@1085 2f5784b3-3f2a-0410-8824-cb99058d5e15
Diffstat (limited to 'pcretest.c')
-rw-r--r--pcretest.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/pcretest.c b/pcretest.c
index 399172d..67bc98d 100644
--- a/pcretest.c
+++ b/pcretest.c
@@ -1731,6 +1731,7 @@ return(result);
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 (c < 0x100)
}
}
-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;
}