svn commit: r303600 - head/usr.bin/indent

Pedro Giffuni pfg at FreeBSD.org
Mon Aug 1 15:36:16 UTC 2016



On 08/01/16 00:28, Xin Li wrote:
>
>
> On 7/31/16 14:36, Pedro F. Giffuni wrote:
>> Author: pfg
>> Date: Sun Jul 31 21:36:40 2016
>> New Revision: 303600
>> URL: https://svnweb.freebsd.org/changeset/base/303600
>>
>> Log:
>>   indent(1): replace function call to bzero with memset.
>>
>>   Reference:
>>   https://github.com/pstef/freebsd_indent/commit/7422f42f80099c69d34833d7106035dc09230235
>>
>>   Differential Revision: https://reviews.freebsd.org/D6966  (Partial)
>>   Submitted by:	Piotr Stefaniak
>>
>> Modified:
>>   head/usr.bin/indent/io.c
>>
>> Modified: head/usr.bin/indent/io.c
>> ==============================================================================
>> --- head/usr.bin/indent/io.c	Sun Jul 31 21:29:10 2016	(r303599)
>> +++ head/usr.bin/indent/io.c	Sun Jul 31 21:36:40 2016	(r303600)
>> @@ -629,7 +629,7 @@ parsefont(struct fstate *f, const char *
>>      const char *s = s0;
>>      int         sizedelta = 0;
>>
>> -    bzero(f, sizeof *f);
>> +    memset(f, 0, sizeof(struct fstate));
>                     ^^^^^^^^^^^^^^^^^^^^^  This is much more error-prone
> than sizeof(*f) IMHO.
>
> Cheers,
>
Does this look better?

Cheers,

Pedro.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: indent-memset.diff
Type: text/x-patch
Size: 409 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/svn-src-head/attachments/20160801/3cb999b0/attachment.bin>


More information about the svn-src-head mailing list