Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 Aug 2016 15:49:31 +0000 (UTC)
From:      "Pedro F. Giffuni" <pfg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r304686 - head/usr.bin/indent
Message-ID:  <201608231549.u7NFnViG041225@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pfg
Date: Tue Aug 23 15:49:31 2016
New Revision: 304686
URL: https://svnweb.freebsd.org/changeset/base/304686

Log:
  indent(1): have the memset invocation somewhat more canonical.
  
  While correct, the previous invocation was somewhat more error prone.
  
  Pointed out by:	delphij, bde

Modified:
  head/usr.bin/indent/io.c

Modified: head/usr.bin/indent/io.c
==============================================================================
--- head/usr.bin/indent/io.c	Tue Aug 23 15:48:27 2016	(r304685)
+++ head/usr.bin/indent/io.c	Tue Aug 23 15:49:31 2016	(r304686)
@@ -630,7 +630,7 @@ parsefont(struct fstate *f, const char *
     const char *s = s0;
     int         sizedelta = 0;
 
-    memset(f, 0, sizeof(struct fstate));
+    memset(f, '\0', sizeof(*f));
     while (*s) {
 	if (isdigit(*s))
 	    f->size = f->size * 10 + *s - '0';



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201608231549.u7NFnViG041225>