Source-Changes-HG archive

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

[src/trunk]: src/external/bsd/cron/dist Make crontab(1) work again which got ...



details:   https://anonhg.NetBSD.org/src/rev/cad4136428cf
branches:  trunk
changeset: 802252:cad4136428cf
user:      tron <tron%NetBSD.org@localhost>
date:      Sun Sep 07 13:35:27 2014 +0000

description:
Make crontab(1) work again which got broken by the last commit.

diffstat:

 external/bsd/cron/dist/env.c |  11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diffs (39 lines):

diff -r 7b89a6e2a637 -r cad4136428cf external/bsd/cron/dist/env.c
--- a/external/bsd/cron/dist/env.c      Sun Sep 07 13:34:12 2014 +0000
+++ b/external/bsd/cron/dist/env.c      Sun Sep 07 13:35:27 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: env.c,v 1.3 2014/09/05 21:32:37 christos Exp $ */
+/*     $NetBSD: env.c,v 1.4 2014/09/07 13:35:27 tron Exp $     */
 
 /* Copyright 1988,1990,1993,1994 by Paul Vixie
  * All rights reserved
@@ -25,7 +25,7 @@
 #if 0
 static char rcsid[] = "Id: env.c,v 1.10 2004/01/23 18:56:42 vixie Exp";
 #else
-__RCSID("$NetBSD: env.c,v 1.3 2014/09/05 21:32:37 christos Exp $");
+__RCSID("$NetBSD: env.c,v 1.4 2014/09/07 13:35:27 tron Exp $");
 #endif
 #endif
 
@@ -58,9 +58,9 @@
        for (count = 0; envp[count] != NULL; count++)
                continue;
        p = malloc((count + 1) * sizeof(*p));  /* 1 for the NULL */
-       if (p != NULL)
-           return NULL;
-       for (i = 0; i < count; i++)
+       if (p == NULL)
+               return NULL;
+       for (i = 0; i < count; i++) {
                if ((p[i] = strdup(envp[i])) == NULL) {
                        save_errno = errno;
                        for (count = 0; count < i; count++)
@@ -69,6 +69,7 @@
                        errno = save_errno;
                        return NULL;
                }
+       }
        p[count] = NULL;
        return p;
 }



Home | Main Index | Thread Index | Old Index