summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2004-06-11 03:10:44 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2004-06-11 03:10:44 +0000
commit79dc5f08f8b126a0c99068a8ceb324823e0059cb (patch)
tree7d35bbebd427cbc02b7e32e512f2289d37a2b242
parentaeb89d9c7a27c0ef3d242ad212009b665e7a8130 (diff)
Correct the code that identifies bogus regexps; Jared Yanovich
-rw-r--r--bin/pax/pat_rep.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/bin/pax/pat_rep.c b/bin/pax/pat_rep.c
index 07469a2c813..ce4a2afa2bb 100644
--- a/bin/pax/pat_rep.c
+++ b/bin/pax/pat_rep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pat_rep.c,v 1.27 2004/06/11 03:05:01 millert Exp $ */
+/* $OpenBSD: pat_rep.c,v 1.28 2004/06/11 03:10:43 millert Exp $ */
/* $NetBSD: pat_rep.c,v 1.4 1995/03/21 09:07:33 cgd Exp $ */
/*-
@@ -38,7 +38,7 @@
#if 0
static const char sccsid[] = "@(#)pat_rep.c 8.2 (Berkeley) 4/18/94";
#else
-static const char rcsid[] = "$OpenBSD: pat_rep.c,v 1.27 2004/06/11 03:05:01 millert Exp $";
+static const char rcsid[] = "$OpenBSD: pat_rep.c,v 1.28 2004/06/11 03:10:43 millert Exp $";
#endif
#endif /* not lint */
@@ -121,7 +121,7 @@ rep_add(char *str)
if (*pt1 == *str)
break;
}
- if (pt1 == NULL) {
+ if (*pt1 == '\0') {
paxwarn(1, "Invalid replacement string %s", str);
return(-1);
}
@@ -157,7 +157,7 @@ rep_add(char *str)
if (*pt2 == *str)
break;
}
- if (pt2 == NULL) {
+ if (*pt2 == '\0') {
regfree(&(rep->rcmp));
(void)free((char *)rep);
paxwarn(1, "Invalid replacement string %s", str);