diff --git a/src/modal.c b/src/modal.c index e4f5b6f..7bce9ef 100644 --- a/src/modal.c +++ b/src/modal.c @@ -34,10 +34,11 @@ walk(char *s) static int sint(char *s) { - int r = 0; char c; + int r = 0, n = 1; + if(*s == '-') { n = -1, s++; } while((c = *s++) && c > 0x20) r = r * 10 + c - '0'; - return r; + return r * n; } static void