factor out memcpy (semantic patch ftw)
commit66fe44ab1854a368821871f46b2ab095211512d0
authorygrek <ygrek@autistici.org>
Thu, 11 Jun 2015 23:02:24 +0000 (11 18:02 -0500)
committerygrek <ygrek@autistici.org>
Thu, 11 Jun 2015 23:02:24 +0000 (11 18:02 -0500)
tree77f3a34f75913bd537756d00c6d77aa332fe1939
parent66b97209207338b6c126a06eae81d1f9e64586ce
factor out memcpy (semantic patch ftw)

@@
expression E;
identifier str;
@@

- str = (char *)malloc(string_length(E)+1);
- memcpy(str, String_val(E), string_length(E));
- str[string_length(E)] = 0;
+ str = strdup_ml(E);
curl-helper.c