Source-Changes-HG archive

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

[src/trunk]: src/external/bsd/blacklist/bin initialize the return conf and al...



details:   https://anonhg.NetBSD.org/src/rev/90b6df4e1deb
branches:  trunk
changeset: 805842:90b6df4e1deb
user:      christos <christos%NetBSD.org@localhost>
date:      Wed Jan 21 21:25:13 2015 +0000

description:
initialize the return conf and also copy the rest of the members back.

diffstat:

 external/bsd/blacklist/bin/conf.c |  7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diffs (35 lines):

diff -r be757ea37e5f -r 90b6df4e1deb external/bsd/blacklist/bin/conf.c
--- a/external/bsd/blacklist/bin/conf.c Wed Jan 21 21:24:51 2015 +0000
+++ b/external/bsd/blacklist/bin/conf.c Wed Jan 21 21:25:13 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: conf.c,v 1.4 2015/01/21 19:24:03 christos Exp $        */
+/*     $NetBSD: conf.c,v 1.5 2015/01/21 21:25:13 christos Exp $        */
 
 /*-
  * Copyright (c) 2015 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: conf.c,v 1.4 2015/01/21 19:24:03 christos Exp $");
+__RCSID("$NetBSD: conf.c,v 1.5 2015/01/21 21:25:13 christos Exp $");
 
 #include <stdio.h>
 #include <string.h>
@@ -367,6 +367,7 @@
        size_t i;
        char buf[BUFSIZ];
 
+       memset(cr, 0, sizeof(*cr));
        slen = sizeof(ss);
        memset(&ss, 0, slen);
        if (getsockname(fd, (void *)&ss, &slen) == -1) {
@@ -426,6 +427,8 @@
                        if (debug)
                                printf("%s\n", conf_print(buf, sizeof(buf),
                                    "found:\t", "\t", &conf[i]));
+                       cr->c_ss = conf[i].c_ss;
+                       memcpy(cr->c_name, conf[i].c_name, CONFNAMESZ);
                        cr->c_nfail = conf[i].c_nfail;
                        cr->c_duration = conf[i].c_duration;
                        return cr;



Home | Main Index | Thread Index | Old Index