]> git.sesse.net Git - fjl/blobdiff - unstuff.c
Fix signedness warnings.
[fjl] / unstuff.c
index 4a69178133af7443dee7d6b2ecec275f8f7930f1..997a56241825016fd8a81a19800ddc98af812b05 100644 (file)
--- a/unstuff.c
+++ b/unstuff.c
@@ -34,7 +34,7 @@ int unstuff_fast(uint8_t* dst, const uint8_t* src, size_t len)
        size_t bytes_read = 0;
        size_t bytes_written = 0;
 
-       while (len - bytes_read >= 0) {
+       while (bytes_read < len) {
                // Find the first marker byte in the rest of the stream.
                const uint8_t* ptr = memchr(src, MARKER_CHAR, len - bytes_read);
                if (ptr == NULL) {