[Pcre-svn] [1066] code/trunk/pcre_compile.c: pcre32: compile…

Startseite
Nachricht löschen
Autor: Subversion repository
Datum:  
To: pcre-svn
Betreff: [Pcre-svn] [1066] code/trunk/pcre_compile.c: pcre32: compile: Fix signed/ unsigned mismatch in read_repeat_counts
Revision: 1066
          http://vcs.pcre.org/viewvc?view=rev&revision=1066
Author:   chpe
Date:     2012-10-16 16:54:19 +0100 (Tue, 16 Oct 2012)


Log Message:
-----------
pcre32: compile: Fix signed/unsigned mismatch in read_repeat_counts

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


Modified: code/trunk/pcre_compile.c
===================================================================
--- code/trunk/pcre_compile.c    2012-10-16 15:54:16 UTC (rev 1065)
+++ code/trunk/pcre_compile.c    2012-10-16 15:54:19 UTC (rev 1066)
@@ -1311,7 +1311,7 @@
 /* Read the minimum value and do a paranoid check: a negative value indicates
 an integer overflow. */


-while (IS_DIGIT(*p)) min = min * 10 + *p++ - CHAR_0;
+while (IS_DIGIT(*p)) min = min * 10 + (int)(*p++ - CHAR_0);
 if (min < 0 || min > 65535)
   {
   *errorcodeptr = ERR5;
@@ -1326,7 +1326,7 @@
   if (*(++p) != CHAR_RIGHT_CURLY_BRACKET)
     {
     max = 0;
-    while(IS_DIGIT(*p)) max = max * 10 + *p++ - CHAR_0;
+    while(IS_DIGIT(*p)) max = max * 10 + (int)(*p++ - CHAR_0);
     if (max < 0 || max > 65535)
       {
       *errorcodeptr = ERR5;