svn commit: r304686 - head/usr.bin/indent

Pedro F. Giffuni pfg at FreeBSD.org
Tue Aug 23 15:49:32 UTC 2016


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';


More information about the svn-src-head mailing list