Source-Changes-HG archive

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

[src/trunk]: src/lib/libc/time PR 51003 David Binderman: bzero struct before ...



details:   https://anonhg.NetBSD.org/src/rev/6c3af19769f0
branches:  trunk
changeset: 815657:6c3af19769f0
user:      dholland <dholland%NetBSD.org@localhost>
date:      Tue May 31 03:47:49 2016 +0000

description:
PR 51003 David Binderman: bzero struct before passing it around.

This is actually unnecessary as the call in question uses only fields
that have been set explicitly, but good practice regardless and it's
not like it's on a performance-critical path.

diffstat:

 lib/libc/time/zic.c |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (26 lines):

diff -r dc4dd08d609b -r 6c3af19769f0 lib/libc/time/zic.c
--- a/lib/libc/time/zic.c       Tue May 31 03:43:10 2016 +0000
+++ b/lib/libc/time/zic.c       Tue May 31 03:47:49 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: zic.c,v 1.57 2016/03/15 15:16:01 christos Exp $        */
+/*     $NetBSD: zic.c,v 1.58 2016/05/31 03:47:49 dholland Exp $        */
 /*
 ** This file is in the public domain, so clarified as of
 ** 2006-07-17 by Arthur David Olson.
@@ -10,7 +10,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: zic.c,v 1.57 2016/03/15 15:16:01 christos Exp $");
+__RCSID("$NetBSD: zic.c,v 1.58 2016/05/31 03:47:49 dholland Exp $");
 #endif /* !defined lint */
 
 #include "private.h"
@@ -2551,6 +2551,7 @@
                */
                struct rule xr;
                struct attype *lastat;
+               memset(&xr, 0, sizeof(xr));
                xr.r_month = TM_JANUARY;
                xr.r_dycode = DC_DOM;
                xr.r_dayofmonth = 1;



Home | Main Index | Thread Index | Old Index