aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorozan yigit <ozan.yigit@gmail.com>2023-10-30 19:56:09 -0400
committerozan yigit <ozan.yigit@gmail.com>2023-10-30 19:56:09 -0400
commit9666b77b369e342353c29eed5415123f58e58948 (patch)
treebaa8d97e3e2432ff25764bd3b83ba85e9f996bc9
parent0575fbc687f4ce8de6e25848350069a44bbe48ff (diff)
parent0048c96e94c732c6fb2ebe50eeb3450c1672fe0f (diff)
downloadone-true-awk-9666b77b369e342353c29eed5415123f58e58948.tar.gz
todd miller's fix for big-endian systems, and out of bounds read
for empty CCL.
-rw-r--r--b.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/b.c b/b.c
index 9792a97..aa07d59 100644
--- a/b.c
+++ b/b.c
@@ -529,7 +529,7 @@ int first(Node *p) /* collects initially active leaves of p into setvec */
setvec[lp] = 1;
setcnt++;
}
- if (type(p) == CCL && (*(char *) right(p)) == '\0')
+ if (type(p) == CCL && (*(int *) right(p)) == 0)
return(0); /* empty CCL */
return(1);
case PLUS:
@@ -970,7 +970,7 @@ Node *primary(void)
rtok = relex();
if (rtok == ')') { /* special pleading for () */
rtok = relex();
- return unary(op2(CCL, NIL, (Node *) tostring("")));
+ return unary(op2(CCL, NIL, (Node *) cclenter("")));
}
np = regexp();
if (rtok == ')') {
@@ -993,7 +993,7 @@ Node *concat(Node *np)
return (concat(op2(CAT, np, primary())));
case EMPTYRE:
rtok = relex();
- return (concat(op2(CAT, op2(CCL, NIL, (Node *) tostring("")),
+ return (concat(op2(CAT, op2(CCL, NIL, (Node *) cclenter("")),
primary())));
}
return (np);