Added dupe check

This commit is contained in:
Michiel Broek 2005-04-18 19:13:14 +00:00
parent 08860e2e79
commit ae22fe9048

View File

@ -163,6 +163,14 @@ void add_server(srv_list **fdp, char *name, int hops, char *prod, char *vers, ch
srv_list *tmp, *ta; srv_list *tmp, *ta;
Syslog('r', "add_server %s %d %s %s %s", name, hops, prod, vers, fullname); Syslog('r', "add_server %s %d %s %s %s", name, hops, prod, vers, fullname);
for (ta = *fdp; ta; ta = ta->next) {
if (strcmp(ta->server, name) == 0) {
Syslog('r', "duplicate, ignore");
return;
}
}
tmp = (srv_list *)malloc(sizeof(srv_list)); tmp = (srv_list *)malloc(sizeof(srv_list));
memset(tmp, 0, sizeof(tmp)); memset(tmp, 0, sizeof(tmp));
tmp->next = NULL; tmp->next = NULL;