I am a beginner in coccinelle and try to run my first example.
Currently I'am following the steps of this article
I run it using
$ spatch -sp_file test.cocci test.c
In the terminal I got the expected result as mentioned in the article
--- test.c
+++ /tmp/cocci-output-17416-b5450d-test.c
@@ -7,7 +7,7 @@ main(int argc, char *argv[])
char *buf;
/* allocate memory */
- buf = alloca(bytes);
+ buf = malloc(bytes);
return 0;
}
However the c file didn't change as expected.
Can any body tell me where can I get the changes made by the script?
using
spatch --help
I got all the option for the command spatch . So i should use
$ spatch -sp_file test.cocci test.c -o /tmp/newtest.c
the result of runing the patch is in /tmp/newtest.c
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With