--- np2/common/milstr.c 2005/02/07 14:46:08 1.13 +++ np2/common/milstr.c 2005/04/01 15:35:49 1.14 @@ -678,23 +678,24 @@ long STRCALL milstr_solveHEX(const OEMCH long STRCALL milstr_solveINT(const OEMCHAR *str) { - long ret; - int c; - int s = 1; + unsigned long ret; + BOOL minus; + int c; ret = 0; + minus = FALSE; c = *str; if (c == '+') { str++; } else if (c == '-') { str++; - s = -1; + minus = TRUE; } while(1) { c = *str++; c -= '0'; - if ((unsigned)c < 10) { + if ((c >= 0) && (c < 10)) { ret *= 10; ret += c; } @@ -702,7 +703,12 @@ long STRCALL milstr_solveINT(const OEMCH break; } } - return(ret * s); + if (!minus) { + return((long)ret); + } + else { + return((long)(0 - ret)); + } } OEMCHAR * STRCALL milstr_list(const OEMCHAR *lststr, UINT pos) {