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: pgpR71ytY8TYv.pgp
Description: PGP signature

Reply via email to