summaryrefslogtreecommitdiff
path: root/src/or/config.c
diff options
context:
space:
mode:
authorKevin Butler <haqkrs@gmail.com>2013-09-03 17:47:03 +0100
committerKevin Butler <haqkrs@gmail.com>2013-09-03 17:47:03 +0100
commitdb318dc77f47157d685fdd9e2035c96574b283db (patch)
tree7c4cffa743ec86cc6f83bbd0d031cd7a3623eb8f /src/or/config.c
parentbb69bf888288a3a3debc40d7630640314dc0ebcb (diff)
downloadtor-db318dc77f47157d685fdd9e2035c96574b283db.tar.gz
tor-db318dc77f47157d685fdd9e2035c96574b283db.zip
Minor changes to adhere to codebase conventions.
Diffstat (limited to 'src/or/config.c')
-rw-r--r--src/or/config.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/or/config.c b/src/or/config.c
index 594e0100d6..436fcc4992 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -3090,7 +3090,7 @@ options_validate(or_options_t *old_options, or_options_t *options,
"You should also make sure you aren't listing this bridge's "
"fingerprint in any other MyFamily.");
}
- if (check_nickname_list((char **)&options->MyFamily, "MyFamily", msg))
+ if (check_nickname_list(&options->MyFamily, "MyFamily", msg))
return -1;
for (cl = options->NodeFamilies; cl; cl = cl->next) {
routerset_t *rs = routerset_new();
@@ -3639,15 +3639,14 @@ check_nickname_list(char **lst, const char *name, char **msg)
smartlist_split_string(sl, *lst, ",",
SPLIT_SKIP_SPACE|SPLIT_IGNORE_BLANK|SPLIT_STRIP_SPACE, 0);
- SMARTLIST_FOREACH(sl, char *, s,
+ SMARTLIST_FOREACH_BEGIN(sl, char *, s)
{
if (!is_legal_nickname_or_hexdigest(s)) {
// check if first char is dollar
if (s[0] != '$') {
// Try again but with a dollar symbol prepended
- char *prepended = tor_malloc(strlen(s)+2);
- strcpy(prepended, "$");
- strcat(prepended, s);
+ char *prepended;
+ tor_asprintf(&prepended, "$%s", s);
if (is_legal_nickname_or_hexdigest(prepended)) {
// The nickname is valid when it's prepended, swap the current
@@ -3666,7 +3665,8 @@ check_nickname_list(char **lst, const char *name, char **msg)
r = -1;
break;
}
- });
+ }
+ SMARTLIST_FOREACH_END(s);
// Replace the caller's nickname list with a fixed one
if (changes && r == 0) {