From: Willem Toorop Date: Mon, 6 Oct 2014 08:45:47 +0000 (+0200) Subject: Process a review comment X-Git-Tag: release-1.7.0-rc1~136 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=85de578d77efd36e0633211403a4ef452964b7d4;p=thirdparty%2Fldns.git Process a review comment --- diff --git a/rr.c b/rr.c index 40fdad19..e52ea809 100644 --- a/rr.c +++ b/rr.c @@ -670,14 +670,19 @@ ldns_rr_new_question_frm_str(ldns_rr **newrr, const char *str, true); } +/* Strip whitespace from the start and the end of . */ static char * ldns_strip_ws(char *line) { char *s = line, *e; - for (s = line; *s && isspace(*s); s++); - for (e = strchr(s, 0); e-2 > s && isspace(e[-1]) && e[-2] != '\\'; e--); + for (s = line; *s && isspace(*s); s++) + ; + + for (e = strchr(s, 0); e > s+2 && isspace(e[-1]) && e[-2] != '\\'; e--) + ; *e = 0; + return s; }