From owner-svn-src-all@FreeBSD.ORG Sat Dec 17 21:50:59 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4B9EF106564A; Sat, 17 Dec 2011 21:50:59 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (cl-327.ede-01.nl.sixxs.net [IPv6:2001:7b8:2ff:146::2]) by mx1.freebsd.org (Postfix) with ESMTP id 0C50E8FC12; Sat, 17 Dec 2011 21:50:59 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:34d8:b0a6:3463:89c2] (unknown [IPv6:2001:7b8:3a7:0:34d8:b0a6:3463:89c2]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 1CB875C37; Sat, 17 Dec 2011 22:50:58 +0100 (CET) Message-ID: <4EED0EC7.90203@FreeBSD.org> Date: Sat, 17 Dec 2011 22:51:03 +0100 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:9.0) Gecko/20111130 Thunderbird/9.0 MIME-Version: 1.0 To: Kostik Belousov References: <201112172137.pBHLbMAo077674@svn.freebsd.org> <20111217214440.GB50300@deviant.kiev.zoral.com.ua> In-Reply-To: <20111217214440.GB50300@deviant.kiev.zoral.com.ua> X-Enigmail-Version: 1.3.4 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Dec 2011 21:50:59 -0000 On 2011-12-17 22:44, Kostik Belousov wrote: >> #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. The for loop took the address of the left-top corner of the two-dimensional array, and iterated with a char pointer to the address just after the right-bottom corner of the array. It was in effect a memset, just hand-written.