summaryrefslogtreecommitdiff
path: root/lzf_c.c
diff options
context:
space:
mode:
authorroot <root>2007-11-13 10:56:56 +0000
committerroot <root>2007-11-13 10:56:56 +0000
commit2377e800b66884301825c071cc9667583d0b2e31 (patch)
tree2e9a7d40373e99bad561b4fa16da5fac9e44b265 /lzf_c.c
parentd29dfa6df56424f073e0de300f6b2e40f5ace61a (diff)
*** empty log message ***
Diffstat (limited to 'lzf_c.c')
-rw-r--r--lzf_c.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lzf_c.c b/lzf_c.c
index 98371c5..bf86f1d 100644
--- a/lzf_c.c
+++ b/lzf_c.c
@@ -256,7 +256,7 @@ lzf_compress (const void *const in_data, unsigned int in_len,
}
}
- if (op + lit + 2 >= out_end)
+ if (op + 2 >= out_end)
return 0;
while (ip < in_end)
@@ -265,7 +265,8 @@ lzf_compress (const void *const in_data, unsigned int in_len,
*op++ = *ip++;
}
- op [- lit - 1] = lit - 1;
+ op [- lit - 1] = lit - 1; /* end run */
+ op -= !lit; /* undo run if length is zero */
return op - (u8 *)out_data;
}