Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 17 Dec 2011 23:44:40 +0200
From:      Kostik Belousov <kostikbel@gmail.com>
To:        Dimitry Andric <dim@freebsd.org>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r228663 - head/usr.sbin/lpr/filters
Message-ID:  <20111217214440.GB50300@deviant.kiev.zoral.com.ua>
In-Reply-To: <201112172137.pBHLbMAo077674@svn.freebsd.org>
References:  <201112172137.pBHLbMAo077674@svn.freebsd.org>

index | next in thread | previous in thread | raw e-mail

[-- Attachment #1 --]
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) {

[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.18 (FreeBSD)

iEYEARECAAYFAk7tDUgACgkQC3+MBN1Mb4hDeACfTMLTK2w88UwQVbonsFMGh9up
UHkAnAmvsitP7yzHuo7O3opwmADgKf/P
=xkOO
-----END PGP SIGNATURE-----
help

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