flate

deflate implementation
git clone git://git.suckless.org/flate
Log | Files | Refs | README

commit b7c7df969c1390086c6dbe0160646e923cc636df
parent f03a6f1d3efa723e6af183b54c76fc37a9c2cf4c
Author: nsz <nszabolcs@gmail.com>
Date:   Mon, 24 Aug 2009 08:48:26 +0200

comment, -s ldflag
Diffstat:
Makefile | 2+-
sflate.c | 7+++++--
2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile @@ -1,6 +1,6 @@ #CFLAGS=-g -Wall -ansi -pedantic CFLAGS=-O3 -Wall -ansi -pedantic -LDFLAGS= +LDFLAGS=-s SRC=inflate.c inflate_simple.c deflate.c \ sflate.c crc.c adler.c OBJ=${SRC:.c=.o} diff --git a/sflate.c b/sflate.c @@ -175,7 +175,9 @@ int deflate_pkzip_header(uchar *p, int n) { int deflate_pkzip_footer(uchar *p, int n, uint sum, uint len, uint zlen) { if (n < PKDirSize + PKNameLen + 22) return FlateErr; -/* if (n < 16 + PKDirSize + PKNameLen + 22) + /* unzip bug */ +/* + if (n < 16 + PKDirSize + PKNameLen + 22) return FlateErr; set32le(p, PKDataID); set32le(p+4, sum); @@ -201,7 +203,8 @@ int deflate_pkzip_footer(uchar *p, int n, uint sum, uint len, uint zlen) { set32le(p+12, PKDirSize + PKNameLen); set32le(p+16, zlen + PKHeadSize + PKNameLen); return PKDirSize + PKNameLen + 22; -/* set32le(p+12, 16 + PKDirSize + PKNameLen); +/* + set32le(p+12, 16 + PKDirSize + PKNameLen); set32le(p+16, zlen + PKHeadSize + PKNameLen); return 16 + PKDirSize + PKNameLen + 22; */