sfeed

Simple RSS and Atom feed parser
git clone https://git.sinitax.com/codemadness/sfeed
Log | Files | Refs | README | LICENSE | Upstream | sfeed.txt

commit 9e979da3399e46e243a5dc9023a0c77e0f6377a2
parent 5bbec445477ebb16e88596a56db2034da90de325
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date:   Wed,  2 Mar 2016 20:44:48 +0100

sfeed: no need to call strlen, we know the length already

Diffstat:
Msfeed.c | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sfeed.c b/sfeed.c @@ -380,7 +380,7 @@ string_print_encoded(String *s) for (p = s->data; *p && isspace((int)*p); p++) ; /* seek offset of trailing whitespace */ - for (e = p + strlen(p); e > p && isspace((int)*(e - 1)); e--) + for (e = s->data + s->len; e > p && isspace((int)*(e - 1)); e--) ; for (; *p && p != e; p++) { @@ -411,7 +411,7 @@ string_print_trimmed(String *s) for (p = s->data; *p && isspace((int)*p); p++) ; /* seek offset of trailing whitespace */ - for (e = p + strlen(p); e > p && isspace((int)*(e - 1)); e--) + for (e = s->data + s->len; e > p && isspace((int)*(e - 1)); e--) ; for (; *p && p != e; p++) {