[Pcre-svn] [862] code/trunk/pcretest.c: Diagnose more than 8…

Top Page
Delete this message
Author: Subversion repository
Date:  
To: pcre-svn
Subject: [Pcre-svn] [862] code/trunk/pcretest.c: Diagnose more than 8 hex digits in \x{... } in pcretest data lines.
Revision: 862
          http://vcs.pcre.org/viewvc?view=rev&revision=862
Author:   ph10
Date:     2012-01-11 16:07:32 +0000 (Wed, 11 Jan 2012)


Log Message:
-----------
Diagnose more than 8 hex digits in \x{...} in pcretest data lines.

Modified Paths:
--------------
    code/trunk/pcretest.c


Modified: code/trunk/pcretest.c
===================================================================
--- code/trunk/pcretest.c    2012-01-10 14:54:28 UTC (rev 861)
+++ code/trunk/pcretest.c    2012-01-11 16:07:32 UTC (rev 862)
@@ -2104,9 +2104,9 @@
 #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 @@
           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;