summaryrefslogtreecommitdiff
path: root/usr.bin/msgc/msg_sys.def
diff options
context:
space:
mode:
authorcgd <cgd@NetBSD.org>1999-06-19 00:40:29 +0000
committercgd <cgd@NetBSD.org>1999-06-19 00:40:29 +0000
commit49aa92dfc0acd1d4fd43d96d19d55d3fa45d0ac9 (patch)
tree501a1ecfbcaa0cb44385b22151e3f29ce9402659 /usr.bin/msgc/msg_sys.def
parent5fa829d0bd4c4783c2d926d6a56c75d3060a5519 (diff)
don't dereference NULL when thinking about copying the default
Diffstat (limited to 'usr.bin/msgc/msg_sys.def')
-rw-r--r--usr.bin/msgc/msg_sys.def4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/msgc/msg_sys.def b/usr.bin/msgc/msg_sys.def
index be27279c360..4b18a12d366 100644
--- a/usr.bin/msgc/msg_sys.def
+++ b/usr.bin/msgc/msg_sys.def
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_sys.def,v 1.4 1999/06/19 00:13:19 cgd Exp $ */
+/* $NetBSD: msg_sys.def,v 1.5 1999/06/19 00:40:29 cgd Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@@ -183,7 +183,7 @@ static void msg_vprompt (char *msg, char *def, char *val, int max_chars,
if (count != 0) {
ibuf[count] = '\0';
strcpy(val, ibuf); /* size known to be OK */
- } else if (val != def) {
+ } else if (def != NULL && val != def) {
strncpy(val, def, max_chars);
val[max_chars - 1] = '\0';
}