[Cocci] what's wrong with this SmPL?

Németh Márton nm127 at freemail.hu
Sat Nov 21 23:09:49 CET 2009


Hi,
Julia Lawall wrote:
>> @@
>> expression buffer;
>> expression field;
>> expression size;
>> expression str;
>> @@
>> 	memset(buffer, 0, size);
>> 	...
>> -	strncpy(
>> +	strlcpy(
>> 	buffer->field, str, sizeof(buffer->field)
>> 	);
> 
> field is not an expression, since it in itself does not have a value.  It 
> should be classified as an identifier.  Identifier should also be used if 
> you are matching a variable declaration or the header of a function 
> declaration.

Thanks for the hint, now it is working.

Wow, what a powerful tool you made!

Regards,

	Márton Németh


More information about the Cocci mailing list