svn commit: r228663 - head/usr.sbin/lpr/filters

Kostik Belousov kostikbel at gmail.com
Sat Dec 17 21:44:46 UTC 2011


On Sat, Dec 17, 2011 at 09:37:22PM +0000, Dimitry Andric wrote:
> Author: dim
> Date: Sat Dec 17 21:37:21 2011
> New Revision: 228663
> URL: http://svn.freebsd.org/changeset/base/228663
> 
> Log:
>   In usr.sbin/lpr/filters/lpf.c, use a less obtuse way of clearing the
>   buffer, that also avoids warnings.
>   
>   MFC after:	1 week
> 
> Modified:
>   head/usr.sbin/lpr/filters/lpf.c
> 
> Modified: head/usr.sbin/lpr/filters/lpf.c
> ==============================================================================
> --- head/usr.sbin/lpr/filters/lpf.c	Sat Dec 17 20:53:06 2011	(r228662)
> +++ head/usr.sbin/lpr/filters/lpf.c	Sat Dec 17 21:37:21 2011	(r228663)
> @@ -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;
buf is two-dimensional array. This change looks wrong.

>  
>  	while (!done) {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/svn-src-head/attachments/20111217/fb3263a0/attachment.pgp


More information about the svn-src-head mailing list