diff options
| author | dholland <dholland@NetBSD.org> | 2013-08-11 16:36:30 +0000 |
|---|---|---|
| committer | dholland <dholland@NetBSD.org> | 2013-08-11 16:36:30 +0000 |
| commit | 87f1a997e79f08c8dc5a0f0fbe9cee8a07907434 (patch) | |
| tree | 70c66c98cf2822abce7f186ba02af935bf0db350 | |
| parent | d159cfbd1eb26d86b280786bf90d58a2c4f332fc (diff) | |
Don't try to estrdup() NULL; thanks martin@
| -rw-r--r-- | libexec/getty/subr.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libexec/getty/subr.c b/libexec/getty/subr.c index 1742a8d4972..4726f5dcda0 100644 --- a/libexec/getty/subr.c +++ b/libexec/getty/subr.c @@ -1,4 +1,4 @@ -/* $NetBSD: subr.c,v 1.34 2013/08/11 05:42:41 dholland Exp $ */ +/* $NetBSD: subr.c,v 1.35 2013/08/11 16:36:30 dholland Exp $ */ /* * Copyright (c) 1983, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "from: @(#)subr.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: subr.c,v 1.34 2013/08/11 05:42:41 dholland Exp $"); +__RCSID("$NetBSD: subr.c,v 1.35 2013/08/11 16:36:30 dholland Exp $"); #endif #endif /* not lint */ @@ -137,7 +137,7 @@ setdefaults(void) for (sp = gettystrs; sp->field; sp++) if (!sp->value) - sp->value = estrdup(sp->defalt); + sp->value = sp->defalt ? estrdup(sp->defalt) : NULL; for (np = gettynums; np->field; np++) if (!np->set) np->value = np->defalt; |
