diff options
author | edwin <edwin@FreeBSD.org> | 2010-06-05 11:41:46 +0000 |
---|---|---|
committer | edwin <edwin@FreeBSD.org> | 2010-06-05 11:41:46 +0000 |
commit | 8ba0b1c6aa6522a669083937f81ef1cb68cdd535 (patch) | |
tree | 70526a916bb29fd1fd3862629ed02609f728f0d4 /usr.bin/calendar | |
parent | 4648b3610816f371dfb653bcb512b5192705f1f0 (diff) | |
download | FreeBSD-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.c | 2 |
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); |