From: Mansour Moufid Date: Sun, 19 Oct 2014 16:18:31 +0000 (-0400) Subject: Refactor the calloc semantic patch. X-Git-Tag: tor-0.2.6.2-alpha~118^2~7 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a746081f385e20422a314f57ac21ad95b7fd0b09;p=thirdparty%2Ftor.git Refactor the calloc semantic patch. This does not change its effects. --- diff --git a/scripts/coccinelle/calloc.cocci b/scripts/coccinelle/calloc.cocci index 8a295eb4fd..f7d7ec0dc3 100644 --- a/scripts/coccinelle/calloc.cocci +++ b/scripts/coccinelle/calloc.cocci @@ -1,15 +1,10 @@ // Use calloc or realloc as appropriate instead of multiply-and-alloc @malloc_to_calloc@ -expression a,b; -@@ -- tor_malloc(a * b) -+ tor_calloc(a, b) - -@malloc_zero_to_calloc@ +identifier f =~ "(tor_malloc|tor_malloc_zero)"; expression a, b; @@ -- tor_malloc_zero(a * b) +- f(a * b) + tor_calloc(a, b) @realloc_to_reallocarray@