[exim-cvs] Fix numeric comparisons for 64b. Bug 1385

Startseite
Nachricht löschen
Nachricht beantworten
Autor: Exim Git Commits Mailing List
Datum:  
To: exim-cvs
Betreff: [exim-cvs] Fix numeric comparisons for 64b. Bug 1385
Gitweb: http://git.exim.org/exim.git/commitdiff/725735cdc6e1fb7a32b23364d75e14557af6de08
Commit:     725735cdc6e1fb7a32b23364d75e14557af6de08
Parent:     c5c2182fe8a0ca17941b129ac430ac6d24482d82
Author:     Jeremy Harris <jgh146exb@???>
AuthorDate: Sun Sep 15 16:41:40 2013 +0100
Committer:  Jeremy Harris <jgh146exb@???>
CommitDate: Sun Sep 15 16:41:40 2013 +0100


    Fix numeric comparisons for 64b.  Bug 1385
---
 src/src/expand.c             |    2 +-
 test/scripts/0000-Basic/0002 |   10 ++++++----
 test/stdout/0002             |    8 +++++---
 3 files changed, 12 insertions(+), 8 deletions(-)


diff --git a/src/src/expand.c b/src/src/expand.c
index dba047b..0d8e702 100644
--- a/src/src/expand.c
+++ b/src/src/expand.c
@@ -6560,7 +6560,7 @@ else
   else
     {
     while (isspace(*endptr)) endptr++;
-    if (*endptr == 0) return (int)value;
+    if (*endptr == 0) return value;
     }
   }


diff --git a/test/scripts/0000-Basic/0002 b/test/scripts/0000-Basic/0002
index 1ea5c4a..b924a09 100644
--- a/test/scripts/0000-Basic/0002
+++ b/test/scripts/0000-Basic/0002
@@ -287,10 +287,12 @@ mask: ${if eq {1}{2}{${mask:invalid}}{NO}}
# Numeric overflow
# >32b should work, >64b not

-4096M      ${if >{1}{4096M}{y}{n}}
-4096000000 ${if >{1}{4096000000}{y}{n}}
-4611686018427387904  ${if >{1}{4611686018427387904} {y}{n}}
-46116860184273879040 ${if >{1}{46116860184273879040}{y}{n}}
+1 > 2047M                ${if >{1}{2047M}{y}{n}}
+1 > 2048M                ${if >{1}{2048M}{y}{n}}
+1 > 4096000000           ${if >{1}{4096000000}{y}{n}}
+1 > 4096M                ${if >{1}{4096M}{y}{n}}
+1 > 4611686018427387904  ${if >{1}{4611686018427387904} {y}{n}}
+1 > 46116860184273879040 ${if >{1}{46116860184273879040}{y}{n}}


# Conditions

diff --git a/test/stdout/0002 b/test/stdout/0002
index 35f1bb9..1cf6a5b 100644
--- a/test/stdout/0002
+++ b/test/stdout/0002
@@ -260,9 +260,11 @@
> # Numeric overflow
> # >32b should work, >64b not
>

-> 4096M      y
-> 4096000000 y
-> 4611686018427387904  y
+> 1 > 2047M                n
+> 1 > 2048M                n
+> 1 > 4096000000           n
+> 1 > 4096M                n
+> 1 > 4611686018427387904  n

> Failed: absolute value of integer "46116860184273879040" is too large (overflow)
>
> # Conditions