diff options
author | ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15> | 2014-04-21 16:11:50 +0000 |
---|---|---|
committer | ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15> | 2014-04-21 16:11:50 +0000 |
commit | 08485470b2bfb9157d5d6f3e6a0b9e5b40583619 (patch) | |
tree | 0c53ee1ca9080b17ea38f4bcfb1ceb80c1d37727 /pcre_compile.c | |
parent | bba7cd02f727e88c9169a8f70dd179b074be8e89 (diff) | |
download | pcre-08485470b2bfb9157d5d6f3e6a0b9e5b40583619.tar.gz |
Fix C++ compiler warnings and silly quantifier size check.
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@1472 2f5784b3-3f2a-0410-8824-cb99058d5e15
Diffstat (limited to 'pcre_compile.c')
-rw-r--r-- | pcre_compile.c | 35 |
1 files changed, 16 insertions, 19 deletions
diff --git a/pcre_compile.c b/pcre_compile.c index 8a5b723..ae0027b 100644 --- a/pcre_compile.c +++ b/pcre_compile.c @@ -1583,30 +1583,30 @@ read_repeat_counts(const pcre_uchar *p, int *minp, int *maxp, int *errorcodeptr) int min = 0; int max = -1; -/* Read the minimum value and do a paranoid check: a negative value indicates -an integer overflow. */ - -while (IS_DIGIT(*p)) min = min * 10 + (int)(*p++ - CHAR_0); -if (min < 0 || min > 65535) +while (IS_DIGIT(*p)) { - *errorcodeptr = ERR5; - return p; - } - -/* Read the maximum value if there is one, and again do a paranoid on its size. -Also, max must not be less than min. */ + min = min * 10 + (int)(*p++ - CHAR_0); + if (min > 65535) + { + *errorcodeptr = ERR5; + return p; + } + } if (*p == CHAR_RIGHT_CURLY_BRACKET) max = min; else { if (*(++p) != CHAR_RIGHT_CURLY_BRACKET) { max = 0; - while(IS_DIGIT(*p)) max = max * 10 + (int)(*p++ - CHAR_0); - if (max < 0 || max > 65535) + while(IS_DIGIT(*p)) { - *errorcodeptr = ERR5; - return p; - } + max = max * 10 + (int)(*p++ - CHAR_0); + if (max > 65535) + { + *errorcodeptr = ERR5; + return p; + } + } if (max < min) { *errorcodeptr = ERR4; @@ -1615,9 +1615,6 @@ if (*p == CHAR_RIGHT_CURLY_BRACKET) max = min; else } } -/* Fill in the required variables, and pass back the pointer to the terminating -'}'. */ - *minp = min; *maxp = max; return p; |