From 110fdc6e441d5e2ef11229486534db0f5e36e87d Mon Sep 17 00:00:00 2001 From: root Date: Tue, 13 Nov 2007 11:30:37 +0000 Subject: *** empty log message *** --- lzf_c.c | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) (limited to 'lzf_c.c') diff --git a/lzf_c.c b/lzf_c.c index 48bdd6a..c9c05a4 100644 --- a/lzf_c.c +++ b/lzf_c.c @@ -237,32 +237,31 @@ lzf_compress (const void *const in_data, unsigned int in_len, } while (len--); #endif + lit = 0; op++; /* start run */ - continue; } + else + { + /* one more literal byte we must copy */ + if (expect_false (op >= out_end)) + return 0; - /* one more literal byte we must copy */ - - if (expect_false (op >= out_end)) - return 0; - - lit++; - *op++ = *ip++; + lit++; *op++ = *ip++; - if (expect_false (lit == MAX_LIT)) - { - op [- lit - 1] = lit - 1; /* stop run */ - lit = 0; op++; /* start run */ + if (expect_false (lit == MAX_LIT)) + { + op [- lit - 1] = lit - 1; /* stop run */ + lit = 0; op++; /* start run */ + } } } - if (op + 2 >= out_end) + if (op + 2 > out_end) /* at most 2 bytes can be missing here */ return 0; while (ip < in_end) { - lit++; - *op++ = *ip++; + lit++; *op++ = *ip++; } op [- lit - 1] = lit - 1; /* end run */ -- cgit v1.2.3