From: Mansour Moufid Date: Sun, 19 Oct 2014 16:36:46 +0000 (-0400) Subject: Add a rule to the calloc semantic patch for argument ordering. X-Git-Tag: tor-0.2.6.2-alpha~118^2~5 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3ab2c865bfb78e50f7c67c71144fbed37a7b4478;p=thirdparty%2Ftor.git Add a rule to the calloc semantic patch for argument ordering. --- diff --git a/scripts/coccinelle/calloc.cocci b/scripts/coccinelle/calloc.cocci index df0b61de06..fbda88e538 100644 --- a/scripts/coccinelle/calloc.cocci +++ b/scripts/coccinelle/calloc.cocci @@ -8,6 +8,13 @@ constant b; - f(a * b) + tor_calloc(a, b) +@calloc_arg_order@ +expression a; +type t; +@@ +- tor_calloc(sizeof(t), a) ++ tor_calloc(a, sizeof(t)) + @realloc_to_reallocarray@ expression a, b; expression p;