Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 9 Jun 2010 10:36:25 +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: r208943 - head/usr.bin/calendar
Message-ID:  <201006091036.o59AaPMR096200@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: edwin
Date: Wed Jun  9 10:36:25 2010
New Revision: 208943
URL: http://svn.freebsd.org/changeset/base/208943

Log:
  fix memset() calls.
  
  Found with:   Coverity Prevent(tm)
  CID:          8531

Modified:
  head/usr.bin/calendar/locale.c

Modified: head/usr.bin/calendar/locale.c
==============================================================================
--- head/usr.bin/calendar/locale.c	Wed Jun  9 10:14:43 2010	(r208942)
+++ head/usr.bin/calendar/locale.c	Wed Jun  9 10:36:25 2010	(r208943)
@@ -76,7 +76,7 @@ setnnames(void)
 	int i, l;
 	struct tm tm;
 
-	memset(&tm, sizeof(struct tm), 0);
+	memset(&tm, '\0', sizeof(struct tm));
 	for (i = 0; i < 7; i++) {
 		tm.tm_wday = i;
 		strftime(buf, sizeof(buf), "%a", &tm);
@@ -104,7 +104,7 @@ setnnames(void)
 		fndays[i].len = strlen(buf);
 	}
 
-	memset(&tm, sizeof(struct tm), 0);
+	memset(&tm, '\0', sizeof(struct tm));
 	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?201006091036.o59AaPMR096200>