summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>2012-01-11 16:07:32 +0000
committerph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>2012-01-11 16:07:32 +0000
commit47302d0694260f43ec9ecfd0da18a98683f47afe (patch)
tree8f056ec4e8381b9a825118a91c392a90348fd807
parent1afb8c32435f34825d1cc046fa9c742c24b453ad (diff)
downloadpcre-47302d0694260f43ec9ecfd0da18a98683f47afe.tar.gz
Diagnose more than 8 hex digits in \x{...} in pcretest data lines.
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@862 2f5784b3-3f2a-0410-8824-cb99058d5e15
-rw-r--r--pcretest.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/pcretest.c b/pcretest.c
index 133e833..bb3ca45 100644
--- a/pcretest.c
+++ b/pcretest.c
@@ -2104,9 +2104,9 @@ printf("This version of pcretest is not linked with readline().\n");
#endif
printf("\nOptions:\n");
#ifdef SUPPORT_PCRE16
-printf(" -16 use 16-bit interface\n");
+printf(" -16 use the 16-bit library\n");
#endif
-printf(" -b show compiled code (bytecode)\n");
+printf(" -b show compiled code\n");
printf(" -C show PCRE compile-time options and exit\n");
printf(" -C arg show a specific compile-time option\n");
printf(" and exit with its value. The arg can be:\n");
@@ -3464,7 +3464,12 @@ while (!done)
least one MacOS environment. */
for (pt++; isxdigit(*pt); pt++)
- c = c * 16 + tolower(*pt) - ((isdigit(*pt))? '0' : 'a' - 10);
+ {
+ if (++i == 9)
+ fprintf(outfile, "** Too many hex digits in \\x{...} item; "
+ "using only the first eight.\n");
+ else c = c * 16 + tolower(*pt) - ((isdigit(*pt))? '0' : 'a' - 10);
+ }
if (*pt == '}')
{
p = pt + 1;