From e8cbe0bad4284906230a53af4c91ad2b9713d03b Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Wed, 8 Jul 2015 02:46:45 +0000 Subject: fix negated return value of ns_skiprr, breakage in related functions due to a reversed pointer difference computation, ns_skiprr always returned a negative value, which functions using it would interpret as an error. patch by Yu Lu. --- src/network/ns_parse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/network/ns_parse.c b/src/network/ns_parse.c index 3ff33a87..d01da47a 100644 --- a/src/network/ns_parse.c +++ b/src/network/ns_parse.c @@ -95,7 +95,7 @@ int ns_skiprr(const unsigned char *ptr, const unsigned char *eom, ns_sect sectio p += r; } } - return ptr - p; + return p - ptr; bad: errno = EMSGSIZE; return -1; -- cgit v1.2.1