X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=unstuff.c;h=997a56241825016fd8a81a19800ddc98af812b05;hb=e58d7fc6e17349a9a456632f9403a73262a428e5;hp=4a69178133af7443dee7d6b2ecec275f8f7930f1;hpb=d865eae732932b202a0542f721838f3c8d9c5829;p=fjl diff --git a/unstuff.c b/unstuff.c index 4a69178..997a562 100644 --- 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) {