diff options
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/librdns/util.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/contrib/librdns/util.c b/contrib/librdns/util.c index 9ea8f5c43..aa31c96b7 100644 --- a/contrib/librdns/util.c +++ b/contrib/librdns/util.c @@ -556,6 +556,7 @@ rdns_resolver_parse_resolv_conf_cb (struct rdns_resolver *resolver, { FILE *in; char buf[BUFSIZ]; + char *p; in = fopen (path, "r"); @@ -568,6 +569,13 @@ rdns_resolver_parse_resolv_conf_cb (struct rdns_resolver *resolver, break; } + /* Strip trailing spaces */ + p = buf + strlen (buf) - 1; + while (p > buf && + (*p == ' ' || *p == '\t' || *p == '\r' || *p == '\n')) { + *p-- = '\0'; + } + if (!rdns_resolver_conf_process_line (resolver, buf, cb, ud)) { rdns_warn ("rdns_resolver_parse_resolv_conf: cannot parse line: %s", buf); fclose (in); |