svn commit: r229225 - stable/9/usr.sbin/lpr/filters

Dimitry Andric dim at FreeBSD.org
Sun Jan 1 22:34:38 UTC 2012


Author: dim
Date: Sun Jan  1 22:34:37 2012
New Revision: 229225
URL: http://svn.freebsd.org/changeset/base/229225

Log:
  MFC r228663:
  
  In usr.sbin/lpr/filters/lpf.c, use a less obtuse way of clearing the
  buffer, that also avoids warnings.

Modified:
  stable/9/usr.sbin/lpr/filters/lpf.c
Directory Properties:
  stable/9/usr.sbin/lpr/filters/   (props changed)

Modified: stable/9/usr.sbin/lpr/filters/lpf.c
==============================================================================
--- stable/9/usr.sbin/lpr/filters/lpf.c	Sun Jan  1 22:33:55 2012	(r229224)
+++ stable/9/usr.sbin/lpr/filters/lpf.c	Sun Jan  1 22:34:37 2012	(r229225)
@@ -55,6 +55,7 @@ __FBSDID("$FreeBSD$");
 #include <unistd.h>
 #include <stdlib.h>
 #include <stdio.h>
+#include <string.h>
 
 #define MAXWIDTH  132
 #define MAXREP    10
@@ -115,7 +116,7 @@ main(int argc, char *argv[])
 			acctfile = cp;
 	}
 
-	for (cp = buf[0], limit = buf[MAXREP]; cp < limit; *cp++ = ' ');
+	memset(buf, ' ', sizeof(buf));
 	done = 0;
 
 	while (!done) {


More information about the svn-src-all mailing list