summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorespie <espie@openbsd.org>2014-12-07 13:52:17 +0000
committerespie <espie@openbsd.org>2014-12-07 13:52:17 +0000
commit4ef28080814ad716eb98512ab97e2381a9af51c8 (patch)
tree29a94b8584d3af2aa1acb1087e8bb7533cf74c8d
parentAvoid extra space in dmesg (diff)
downloadwireguard-openbsd-4ef28080814ad716eb98512ab97e2381a9af51c8.tar.xz
wireguard-openbsd-4ef28080814ad716eb98512ab97e2381a9af51c8.zip
make sure we always nul-terminate
problem spotted by jsg@ reorg so that the nul termination is obvious.
-rw-r--r--usr.bin/make/targequiv.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.bin/make/targequiv.c b/usr.bin/make/targequiv.c
index ccd0ecc9b6a..9acf80ec6bc 100644
--- a/usr.bin/make/targequiv.c
+++ b/usr.bin/make/targequiv.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: targequiv.c,v 1.5 2014/05/12 19:11:19 espie Exp $ */
+/* $OpenBSD: targequiv.c,v 1.6 2014/12/07 13:52:17 espie Exp $ */
/*
* Copyright (c) 2007-2008 Marc Espie.
*
@@ -221,8 +221,10 @@ parse_reduce(size_t i, const char *src)
}
buffer[i++] = *src++;
}
- buffer[i++] = *src;
+ if (src[0] == '/')
+ buffer[i++] = *src++;
}
+ buffer[i++] = 0;
return i;
}