diff options
-rw-r--r-- | big.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -791,12 +791,13 @@ word bigxscan(char *p, char *q) return r; } -word bigoscan(p, q) /* read unsigned octal number in '\0'-terminated string p to q */ - /* assumes redundant leading zeros removed */ -char *p, *q; +/* read unsigned octal number in '\0'-terminated string p to q */ +/* assumes redundant leading zeros removed */ +word bigoscan(char *p, char *q) { word r; /* will hold result */ word *x = &r; + while (q > p) { unsigned hold; q = q - p < 5 ? p : q - 5; /* read (upto) 5 octal digits from small end */ @@ -804,6 +805,7 @@ char *p, *q; *q = '\0'; *x = make(INT, hold, 0), x = &rest(*x); } + return r; } |