about summary refs log tree commit diff
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2020-11-12 16:42:36 +0100
committerLeah Neukirchen <leah@vuxu.org>2020-11-12 16:42:36 +0100
commit6a8543e3215f73cffe08230fe64b45a86fc15681 (patch)
tree7525edf8ec260c6e63d4034e24a6e67b3eba6bf6
parentc43538fae977484e75058eeb84c69f7decb2b0b0 (diff)
downloadmblaze-6a8543e3215f73cffe08230fe64b45a86fc15681.tar.gz
mblaze-6a8543e3215f73cffe08230fe64b45a86fc15681.tar.xz
mblaze-6a8543e3215f73cffe08230fe64b45a86fc15681.zip
rfc2045: mymemmemnl: make more check idiomatic
-rw-r--r--rfc2045.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/rfc2045.c b/rfc2045.c
index f86d5e2..0f2f943 100644
--- a/rfc2045.c
+++ b/rfc2045.c
@@ -123,7 +123,7 @@ mymemmemnl(const char *h0, size_t k, const char *n0, size_t l)
 	char *r;
 
 	while (k && (r = mymemmem(h0, k, n0, l))) {
-		if (r - h0 < (long)(k - l) &&   // check if r[l] safe to access
+		if (r + l < h0 + k &&   // check if r[l] safe to access
 		    (r[l] == '\r' || r[l] == '\n' || r[l] == '-'))
 			return r;
 		else {