summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorespie <espie@openbsd.org>2010-12-26 13:09:22 +0000
committerespie <espie@openbsd.org>2010-12-26 13:09:22 +0000
commit6d6ed8714ba6d818b0ca24f524be5fb9420d2c5f (patch)
treee8d48593c145af6e038c8c0ad2a0a6af2a013380
parentYet another batch of -Thtml polishing from kristaps@: (diff)
downloadwireguard-openbsd-6d6ed8714ba6d818b0ca24f524be5fb9420d2c5f.tar.xz
wireguard-openbsd-6d6ed8714ba6d818b0ca24f524be5fb9420d2c5f.zip
nits with current being NULL or not.
okay miod@
-rw-r--r--usr.bin/make/lowparse.c6
-rw-r--r--usr.bin/make/parse.c8
2 files changed, 8 insertions, 6 deletions
diff --git a/usr.bin/make/lowparse.c b/usr.bin/make/lowparse.c
index 6b5b2d95ea8..533faa32274 100644
--- a/usr.bin/make/lowparse.c
+++ b/usr.bin/make/lowparse.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lowparse.c,v 1.24 2010/07/19 19:46:44 espie Exp $ */
+/* $OpenBSD: lowparse.c,v 1.25 2010/12/26 13:09:22 espie Exp $ */
/* low-level parsing functions. */
@@ -163,8 +163,8 @@ Parse_FromString(char *str, unsigned long lineno)
if (DEBUG(FOR))
(void)fprintf(stderr, "%s\n----\n", str);
- if (current != NULL)
- Lst_Push(&input_stack, current);
+ Lst_Push(&input_stack, current);
+ assert(current != NULL);
current = new_input_string(str, current->fname, lineno);
}
diff --git a/usr.bin/make/parse.c b/usr.bin/make/parse.c
index 49563165d4e..efc1dab235b 100644
--- a/usr.bin/make/parse.c
+++ b/usr.bin/make/parse.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.c,v 1.99 2010/07/19 19:46:44 espie Exp $ */
+/* $OpenBSD: parse.c,v 1.100 2010/12/26 13:09:22 espie Exp $ */
/* $NetBSD: parse.c,v 1.29 1997/03/10 21:20:04 christos Exp $ */
/*
@@ -1102,12 +1102,14 @@ resolve_include_filename(const char *file, bool isSystem)
if (!isSystem && file[0] != '/') {
/* ... by looking first under the same directory as the
* current file */
- char *slash;
+ char *slash = NULL;
const char *fname;
fname = Parse_Getfilename();
- slash = strrchr(fname, '/');
+ if (fname != NULL)
+ slash = strrchr(fname, '/');
+
if (slash != NULL) {
char *newName;