nl: fix crash on invalid regex

This commit is contained in:
Hiltjo Posthuma 2014-11-16 15:17:24 +01:00 committed by sin
parent ce90cc57d4
commit 3fb0e50668

2
nl.c
View File

@ -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();
} }