summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--big.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/big.c b/big.c
index 642f4b2..8a563e7 100644
--- a/big.c
+++ b/big.c
@@ -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;
}