aboutsummaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
authorpowwow@askgustav.com <powwow@askgustav.com>2019-03-19 16:57:22 (GMT)
committerSteve Slaven <bpk@hoopajoo.net>2019-04-23 20:37:05 (GMT)
commitd45862d2324310b34b8a45f78ba9312ce3a58f1a (patch)
tree1e1e1010e8c5fa4d0ce180787daaa9ad3593ec2e /main.c
parent890c942b59c67377123164b50f1555b0bc7b67f1 (diff)
downloadpowwow-d45862d2324310b34b8a45f78ba9312ce3a58f1a.zip
powwow-d45862d2324310b34b8a45f78ba9312ce3a58f1a.tar.gz
powwow-d45862d2324310b34b8a45f78ba9312ce3a58f1a.tar.bz2
make a variable more local in a function
Diffstat (limited to 'main.c')
-rw-r--r--main.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/main.c b/main.c
index b6988ab..4da7606 100644
--- a/main.c
+++ b/main.c
@@ -1172,7 +1172,7 @@ static int match_weak_action(char *pat, char *line, int *match_s, int *match_e)
char mpat[BUFSIZE], *npat=0, *npat2=0, *src=line, *nsrc=0, c;
ptr *pbuf, buf = (ptr)0;
char *tmp, *realpat = pat;
- int mbeg = 0, mword = 0, prm = -1, p;
+ int mbeg = 0, mword = 0, prm = -1;
TAKE_PTR(pbuf, buf);
@@ -1185,9 +1185,11 @@ static int match_weak_action(char *pat, char *line, int *match_s, int *match_e)
}
unescape(pat);
- for (p = 0; p < NUMPARAM; p++)
- match_s[p] = match_e[p] = 0;
- p = 0;
+ {
+ int p;
+ for (p = 0; p < NUMPARAM; p++)
+ match_s[p] = match_e[p] = 0;
+ }
if (*pat == '^') {
pat++;
@@ -1202,7 +1204,7 @@ static int match_weak_action(char *pat, char *line, int *match_s, int *match_e)
/* $x matches a single word */
tmp = pat + 1;
if (isdigit(*tmp)) {
- p = 0;
+ int p = 0;
while (isdigit(*tmp) && p < NUMPARAM) {
p *= 10;
p += *tmp++ - '0';