From 49aa92dfc0acd1d4fd43d96d19d55d3fa45d0ac9 Mon Sep 17 00:00:00 2001 From: cgd Date: Sat, 19 Jun 1999 00:40:29 +0000 Subject: [PATCH] don't dereference NULL when thinking about copying the default --- usr.bin/msgc/msg_sys.def | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.bin/msgc/msg_sys.def b/usr.bin/msgc/msg_sys.def index be27279c3604..4b18a12d366b 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'; }