[libvirt] [PATCH v2 35/37] Introduce syntax-check rule to prefer VIR_STRDUP over strdup

Eric Blake eblake at redhat.com
Tue Apr 30 15:12:31 UTC 2013


On 04/30/2013 07:03 AM, John Ferlan wrote:
> On 04/29/2013 09:50 AM, Michal Privoznik wrote:
>> ---
>>  cfg.mk | 8 ++++++++
>>  1 file changed, 8 insertions(+)
>>
>> diff --git a/cfg.mk b/cfg.mk
>> index d499ded..4c6d85c 100644
>> --- a/cfg.mk
>> +++ b/cfg.mk
>> @@ -383,6 +383,11 @@ sc_prohibit_asprintf:
>>  	halt='use virAsprintf, not as'printf				\
>>  	  $(_sc_search_regexp)
>>  
>> +sc_prohibit_strdup:
>> +	@prohibit='\<strn?dup\> *\('					\
>> +	halt='use VIR_STRUP, not strdup'				\
> 
> s/STRUP/STRDUP/
> 
> Do there need to be separate rules for STRDUP and STRNDUP?

Nah, one rule for both functions at once is good enough.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 621 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20130430/084c8497/attachment-0001.sig>


More information about the libvir-list mailing list