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