]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Add a rule to the calloc semantic patch for argument ordering.
authorMansour Moufid <mansourmoufid@gmail.com>
Sun, 19 Oct 2014 16:36:46 +0000 (12:36 -0400)
committerNick Mathewson <nickm@torproject.org>
Sun, 2 Nov 2014 16:54:42 +0000 (11:54 -0500)
scripts/coccinelle/calloc.cocci

index df0b61de067e4960c5b8c5e5581591f62f431cce..fbda88e538491dbc8bc0de95c53ec13667fe3d31 100644 (file)
@@ -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;