diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 1997-01-20 19:43:25 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 1997-01-20 19:43:25 +0000 |
commit | f7e578b681f2047c43e6d75930fb5f278543dc32 (patch) | |
tree | 71e7f54a3183f4732b8ae0271c305720236851a4 /usr.bin/awk/b.c | |
parent | 0f2a4655788de684b2544b1175a3aeb883569249 (diff) |
Latest research awk from June 29, 1996
Diffstat (limited to 'usr.bin/awk/b.c')
-rw-r--r-- | usr.bin/awk/b.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.bin/awk/b.c b/usr.bin/awk/b.c index 3baab2ac071..9952d94ed35 100644 --- a/usr.bin/awk/b.c +++ b/usr.bin/awk/b.c @@ -227,11 +227,12 @@ void freetr(Node *p) /* free parse tree */ /* to be seen literally; \056 is not a metacharacter. */ int hexstr(char **pp) /* find and eval hex string at pp, return new p */ -{ +{ /* only pick up one 8-bit byte (2 chars) */ char *p; int n = 0; + int i; - for (p = *pp; isxdigit(*p); p++) { + for (i = 0, p = *pp; i < 2 && isxdigit(*p); i++, p++) { if (isdigit(*p)) n = 16 * n + *p - '0'; else if (*p >= 'a' && *p <= 'f') @@ -243,7 +244,7 @@ int hexstr(char **pp) /* find and eval hex string at pp, return new p */ return n; } -#define isoctdigit(c) ((c) >= '0' && (c) <= '8') /* multiple use of arg */ +#define isoctdigit(c) ((c) >= '0' && (c) <= '7') /* multiple use of arg */ int quoted(char **pp) /* pick up next thing after a \\ */ /* and increment *pp */ |