Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 1 Jan 2012 22:34:37 +0000 (UTC)
From:      Dimitry Andric <dim@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r229225 - stable/9/usr.sbin/lpr/filters
Message-ID:  <201201012234.q01MYc29034508@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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) {



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