summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/make/cmd_exec.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/make/cmd_exec.c b/usr.bin/make/cmd_exec.c
index 2a65e0c384d..ea7e3d8072c 100644
--- a/usr.bin/make/cmd_exec.c
+++ b/usr.bin/make/cmd_exec.c
@@ -1,5 +1,5 @@
/* $OpenPackages$ */
-/* $OpenBSD: cmd_exec.c,v 1.3 2002/08/05 17:04:36 millert Exp $ */
+/* $OpenBSD: cmd_exec.c,v 1.4 2003/10/19 20:23:34 tedu Exp $ */
/*
* Copyright (c) 2001 Marc Espie.
*
@@ -126,7 +126,7 @@ Cmd_Exec(cmd, err)
/* The result is null terminated, Convert newlines to spaces. */
cp = result + length - 1;
- if (*cp == '\n')
+ if (cp >= result && *cp == '\n')
/* A final newline is just stripped. */
*cp-- = '\0';