Date: Sat, 5 Jun 2010 11:41:46 +0000 (UTC) From: Edwin Groothuis <edwin@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r208828 - head/usr.bin/calendar Message-ID: <201006051141.o55BfkBk012416@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: edwin Date: Sat Jun 5 11:41:46 2010 New Revision: 208828 URL: http://svn.freebsd.org/changeset/base/208828 Log: Fix warnings about uninitialized variables. It was mostly harmless since strftime() only used %a and %b anyway. Found with: Coverity Prevent(tm) CID: 7769 Modified: head/usr.bin/calendar/locale.c Modified: head/usr.bin/calendar/locale.c ============================================================================== --- head/usr.bin/calendar/locale.c Sat Jun 5 11:32:31 2010 (r208827) +++ head/usr.bin/calendar/locale.c Sat Jun 5 11:41:46 2010 (r208828) @@ -76,6 +76,7 @@ setnnames(void) int i, l; struct tm tm; + memset(&tm, sizeof(struct tm), 0); for (i = 0; i < 7; i++) { tm.tm_wday = i; strftime(buf, sizeof(buf), "%a", &tm); @@ -103,6 +104,7 @@ setnnames(void) fndays[i].len = strlen(buf); } + memset(&tm, sizeof(struct tm), 0); for (i = 0; i < 12; i++) { tm.tm_mon = i; strftime(buf, sizeof(buf), "%b", &tm);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201006051141.o55BfkBk012416>