Welcome to little lamb

Code » limb » commit ff3f351

Fix siov_memcmp() when beginning matches but is shorter

author Olivier Brunel
2023-12-16 20:51:48 UTC
committer Olivier Brunel
2024-01-01 19:10:12 UTC
parent 53cfa52f9c5329e1b4e4d03b8ba386f491a219ee

Fix siov_memcmp() when beginning matches but is shorter

src/liblimb/siovec.h/siov_memcmp.c +1 -1

diff --git a/src/liblimb/siovec.h/siov_memcmp.c b/src/liblimb/siovec.h/siov_memcmp.c
index ffdd6f6..cf950f7 100644
--- a/src/liblimb/siovec.h/siov_memcmp.c
+++ b/src/liblimb/siovec.h/siov_memcmp.c
@@ -19,5 +19,5 @@ siov_memcmp(const struct iovec *v, unsigned int n, const char *s, size_t len)
         len -= l;
     }
 
-    return r;
+    return (len) ? -1 : r;
 }