summaryrefslogtreecommitdiffstats
path: root/usr.bin/calendar
diff options
context:
space:
mode:
authoredwin <edwin@FreeBSD.org>2010-06-05 11:41:46 +0000
committeredwin <edwin@FreeBSD.org>2010-06-05 11:41:46 +0000
commit8ba0b1c6aa6522a669083937f81ef1cb68cdd535 (patch)
tree70526a916bb29fd1fd3862629ed02609f728f0d4 /usr.bin/calendar
parent4648b3610816f371dfb653bcb512b5192705f1f0 (diff)
downloadFreeBSD-src-8ba0b1c6aa6522a669083937f81ef1cb68cdd535.zip
FreeBSD-src-8ba0b1c6aa6522a669083937f81ef1cb68cdd535.tar.gz
Fix warnings about uninitialized variables.
It was mostly harmless since strftime() only used %a and %b anyway. Found with: Coverity Prevent(tm) CID: 7769
Diffstat (limited to 'usr.bin/calendar')
-rw-r--r--usr.bin/calendar/locale.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/usr.bin/calendar/locale.c b/usr.bin/calendar/locale.c
index 2fe3101..be7501c 100644
--- a/usr.bin/calendar/locale.c
+++ b/usr.bin/calendar/locale.c
@@ -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);
OpenPOWER on IntegriCloud