git.samba.org
/
tridge
/
junkcode.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
better script using python
[tridge/junkcode.git]
/
addstr.c
1
2
char* ipstr_list_add(char **ipstr_list, const struct in_addr *ip)
3
{
4
char *new_str = NULL;
5
6
if (*ipstr_list) {
7
asprintf(&new_str, "%s:%s", *ipstr_list, inet_ntoa(*ip));
8
free(*ipstr_list);
9
} else {
10
asprintf(&new_str, "%s", inet_ntoa(*ip));
11
}
12
13
*ipstr_list = new_str;
14
return new_str;
15
}