summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorroot <root>2008-08-30 06:32:20 +0000
committerroot <root>2008-08-30 06:32:20 +0000
commitd42b054d34e4207843aa3f797193dfa74dab0c24 (patch)
treec6d0567dde018ceeec3788f05f1b687b2eabe14b
parentd52302e9cb04a26c03219da3be74ed68d37cf5d3 (diff)
*** empty log message ***
-rw-r--r--README2
-rw-r--r--lzf_c.c43
2 files changed, 24 insertions, 21 deletions
diff --git a/README b/README
index 35cd059..b5379a3 100644
--- a/README
+++ b/README
@@ -24,6 +24,6 @@ DESCRIPTION
AUTHOR
This library was written by Marc Lehmann <schmorp@schmorp.de> (See also
- http://liblzf.plan9.de/).
+ http://software.schmorp.de/pkg/liblzf).
diff --git a/lzf_c.c b/lzf_c.c
index 848aa22..63cf26a 100644
--- a/lzf_c.c
+++ b/lzf_c.c
@@ -222,37 +222,40 @@ lzf_compress (const void *const in_data, unsigned int in_len,
}
*op++ = off;
+ lit = 0; op++; /* start run */
+
+ ip += len + 1;
+
+ if (expect_false (ip > in_end - 2))
+ break;
- if (expect_true (ip + len < in_end - 2))
- {
#if ULTRA_FAST || VERY_FAST
- ip += len;
+ --ip;
# if VERY_FAST && !ULTRA_FAST
- --ip;
+ --ip;
# endif
- hval = FRST (ip);
+ hval = FRST (ip);
- hval = NEXT (hval, ip);
- htab[IDX (hval)] = ip;
- ip++;
+ hval = NEXT (hval, ip);
+ htab[IDX (hval)] = ip;
+ ip++;
# if VERY_FAST && !ULTRA_FAST
+ hval = NEXT (hval, ip);
+ htab[IDX (hval)] = ip;
+ ip++;
+# endif
+#else
+ ip -= len + 1;
+
+ do
+ {
hval = NEXT (hval, ip);
htab[IDX (hval)] = ip;
ip++;
-# endif
-#else
- do
- {
- hval = NEXT (hval, ip);
- htab[IDX (hval)] = ip;
- ip++;
- }
- while (len--);
-#endif
}
-
- lit = 0; op++; /* start run */
+ while (len--);
+#endif
}
else
{