up io error count if not exiting
[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 }