fixed overrun handling
authorMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Mon, 26 Nov 2007 01:32:14 +0000 (01:32 +0000)
committerMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Mon, 26 Nov 2007 01:32:14 +0000 (01:32 +0000)
[r18533]

lexer.c

diff --git a/lexer.c b/lexer.c
index a53325b..74f76c5 100644 (file)
--- a/lexer.c
+++ b/lexer.c
@@ -336,7 +336,7 @@ static unsigned long long parse_int_string(const char *s, const char **endptr, i
        case 16:
                for (;; ++s) {
                        /* check for overrun */
-                       if (v <= 0x1000000000000000ULL)
+                       if (v >= 0x1000000000000000ULL)
                                break;
                        switch (tolower(*s)) {
                        case '0': v <<= 4; break;
@@ -363,7 +363,7 @@ static unsigned long long parse_int_string(const char *s, const char **endptr, i
        case 8:
                for (;; ++s) {
                        /* check for overrun */
-                       if (v <= 0x2000000000000000ULL)
+                       if (v >= 0x2000000000000000ULL)
                                break;
                        switch (tolower(*s)) {
                        case '0': v <<= 3; break;