Re: [PATCH 2/2] commit: use strbuf_add() to add a buffer to a strbuf

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Oct 01, 2017 at 04:54:14PM +0200, René Scharfe wrote:

> This is shorter, easier and makes the intent clearer.
> 
> Patch generated with Coccinelle and contrib/coccinelle/strbuf.cocci.

Technically this behaves differently if there is a NUL embedded in the
string. I'd expect that to be unlikely in most cases. And when it is
possible, I'd venture to say that the new behavior is likely to be the
correct one.

This case is fine (and any embedded NUL would be cut off by setenv
anyway).  As a general transformation, this is not as obviously safe as
many of the others.  But since we eyeball the output of coccinelle
anyway, it should be fine (and any code which is _relying_ on that
behavior really ought to be rewritten in a less subtle way).

-Peff



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux