nl: fix crash on invalid regex
This commit is contained in:
parent
ce90cc57d4
commit
3fb0e50668
2
nl.c
2
nl.c
|
@ -33,7 +33,7 @@ main(int argc, char *argv[])
|
||||||
r = EARGF(usage());
|
r = EARGF(usage());
|
||||||
mode = r[0];
|
mode = r[0];
|
||||||
if (r[0] == 'p') {
|
if (r[0] == 'p') {
|
||||||
regcomp(&preg, &r[1], REG_NOSUB);
|
eregcomp(&preg, &r[1], REG_NOSUB);
|
||||||
} else if (!strchr("ant", mode)) {
|
} else if (!strchr("ant", mode)) {
|
||||||
usage();
|
usage();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user