diff options
author | 2014-12-07 13:52:17 +0000 | |
---|---|---|
committer | 2014-12-07 13:52:17 +0000 | |
commit | 4ef28080814ad716eb98512ab97e2381a9af51c8 (patch) | |
tree | 29a94b8584d3af2aa1acb1087e8bb7533cf74c8d | |
parent | Avoid extra space in dmesg (diff) | |
download | wireguard-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.c | 6 |
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; } |