/* Set the end of the string to NULL */
s[strcspn(s, "#\r\n")] = 0;
- /* Ignore comment (#) and blank lines (*/
- if (*s == '#' || *s == 0)
+ /* Ignore blank lines */
+ if (*s == 0)
continue;
/* Read the first string (ip) up to the next whitespace */
break;
}
+ /* Skip over the host */
+ s += len;
+
/* Skip past any more spaces */
- s += strspn(s+len, " \t");
+ s += strspn(s, " \t");
/* Anything left? */
- if (*(s+len) != 0) {
+ if (*s != 0) {
avahi_log_error ("%s:%d: Junk on the end of the line!", filename, line);
avahi_free(host);
avahi_free(ip);
void static_hosts_free_all (void)
{
- StaticHost *h;
-
- for (h = hosts; h; h = hosts->hosts_next)
- {
- static_host_free (h);
- }
+ while(hosts)
+ static_host_free(hosts);
}