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.
This commit is contained in:
Rich Felker
2015-07-08 02:46:45 +00:00
parent fb58545f8d
commit e8cbe0bad4
+1 -1
View File
@@ -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;