Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nemequ/liblzf.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Lehmann <schmorpforge@schmorp.de>2007-11-30 13:34:26 +0300
committerMarc Lehmann <schmorpforge@schmorp.de>2007-11-30 13:34:26 +0300
commit1d84629aedec811c57490b218ec878f2f2605116 (patch)
tree5dfce36c6de1eae5147fbd2284e1a2340e8b2d88
parentc276c43bcda50a62177ba3c3ce884a99e4ee4260 (diff)
*** empty log message ***
-rw-r--r--lzf_c.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/lzf_c.c b/lzf_c.c
index 25aabed..0e4d746 100644
--- a/lzf_c.c
+++ b/lzf_c.c
@@ -159,6 +159,8 @@ lzf_compress (const void *const in_data, unsigned int in_len,
unsigned int maxlen = in_end - ip - len;
maxlen = maxlen > MAX_REF ? MAX_REF : maxlen;
+ if (maxlen > 8) maxlen = 8;//D
+
op [- lit - 1] = lit - 1; /* stop run */
op -= !lit; /* undo run if length is zero */
@@ -262,6 +264,12 @@ lzf_compress (const void *const in_data, unsigned int in_len,
while (ip < in_end)
{
lit++; *op++ = *ip++;
+
+ if (expect_false (lit == MAX_LIT))
+ {
+ op [- lit - 1] = lit - 1; /* stop run */
+ lit = 0; op++; /* start run */
+ }
}
op [- lit - 1] = lit - 1; /* end run */