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

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


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

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


Modified: code/trunk/pcre_compile.c
===================================================================
--- code/trunk/pcre_compile.c    2012-10-16 15:54:12 UTC (rev 1064)
+++ code/trunk/pcre_compile.c    2012-10-16 15:54:16 UTC (rev 1065)
@@ -1210,7 +1210,8 @@
 static int
 get_ucp(const pcre_uchar **ptrptr, BOOL *negptr, int *dptr, int *errorcodeptr)
 {
-int c, i, bot, top;
+pcre_uchar c;
+int i, bot, top;
 const pcre_uchar *ptr = *ptrptr;
 pcre_uchar name[32];


@@ -1257,14 +1258,15 @@

 while (bot < top)
   {
+  int r;
   i = (bot + top) >> 1;
-  c = STRCMP_UC_C8(name, PRIV(utt_names) + PRIV(utt)[i].name_offset);
-  if (c == 0)
+  r = STRCMP_UC_C8(name, PRIV(utt_names) + PRIV(utt)[i].name_offset);
+  if (r == 0)
     {
     *dptr = PRIV(utt)[i].value;
     return PRIV(utt)[i].type;
     }
-  if (c > 0) bot = i + 1; else top = i;
+  if (r > 0) bot = i + 1; else top = i;
   }


*errorcodeptr = ERR47;