ソースを参照

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.
Rich Felker 9 年 前
コミット
e8cbe0bad4
1 ファイル変更1 行追加1 行削除
  1. 1 1
      src/network/ns_parse.c

+ 1 - 1
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;