aboutsummaryrefslogtreecommitdiff
path: root/src/common/util.c
diff options
context:
space:
mode:
authorovercaffeinated <overcaffeinated@airmail.cc>2016-10-27 10:26:06 +0100
committerovercaffeinated <overcaffeinated@airmail.cc>2016-10-27 10:26:06 +0100
commit265d5446faf2744569931bc54633684711bbf3ba (patch)
tree80c47c0ef835f971f823d2a472ee188c15979638 /src/common/util.c
parentb8b8b6b70e670cb735b43bc6b90150ab1ed4e2d1 (diff)
downloadtor-265d5446faf2744569931bc54633684711bbf3ba.tar.gz
tor-265d5446faf2744569931bc54633684711bbf3ba.zip
Automated change to use smartlist_add_strdup
Use the following coccinelle script to change uses of smartlist_add(sl, tor_strdup(str)) to smartlist_add_strdup(sl, string) (coccinelle script from nickm via bug 20048): @@ expression a; expression b; @@ - smartlist_add + smartlist_add_strdup (a, - tor_strdup( b - ) )
Diffstat (limited to 'src/common/util.c')
-rw-r--r--src/common/util.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/common/util.c b/src/common/util.c
index 02ccf4ff0f..b1159e5334 100644
--- a/src/common/util.c
+++ b/src/common/util.c
@@ -3576,7 +3576,7 @@ tor_listdir, (const char *dirname))
#endif
if (strcmp(name, ".") &&
strcmp(name, "..")) {
- smartlist_add(result, tor_strdup(name));
+ smartlist_add_strdup(result, name);
}
if (!FindNextFile(handle, &findData)) {
DWORD err;
@@ -3602,7 +3602,7 @@ tor_listdir, (const char *dirname))
if (!strcmp(de->d_name, ".") ||
!strcmp(de->d_name, ".."))
continue;
- smartlist_add(result, tor_strdup(de->d_name));
+ smartlist_add_strdup(result, de->d_name);
}
closedir(d);
#endif
@@ -4873,7 +4873,7 @@ get_current_process_environment_variables(void)
char **environ_tmp; /* Not const char ** ? Really? */
for (environ_tmp = get_environment(); *environ_tmp; ++environ_tmp) {
- smartlist_add(sl, tor_strdup(*environ_tmp));
+ smartlist_add_strdup(sl, *environ_tmp);
}
return sl;
@@ -5256,7 +5256,7 @@ tor_get_lines_from_handle, (FILE *handle,
goto done;
if (!lines) lines = smartlist_new();
- smartlist_add(lines, tor_strdup(stdout_buf));
+ smartlist_add_strdup(lines, stdout_buf);
}
done: