Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/libexec/getty Don't try to estrdup() NULL; thanks martin@



details:   https://anonhg.NetBSD.org/src/rev/6c8036ae2146
branches:  trunk
changeset: 789251:6c8036ae2146
user:      dholland <dholland%NetBSD.org@localhost>
date:      Sun Aug 11 16:36:30 2013 +0000

description:
Don't try to estrdup() NULL; thanks martin@

diffstat:

 libexec/getty/subr.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 173c3d2b59a3 -r 6c8036ae2146 libexec/getty/subr.c
--- a/libexec/getty/subr.c      Sun Aug 11 16:15:52 2013 +0000
+++ b/libexec/getty/subr.c      Sun Aug 11 16:36:30 2013 +0000
@@ -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 @@
 
        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;



Home | Main Index | Thread Index | Old Index