X-Git-Url: http://git.sourceforge.jp/view?p=pf3gnuchains%2Fgcc-fork.git;a=blobdiff_plain;f=zlib%2Funcompr.c;h=8519d9bfaf83b67655e5414edb168a64abf8cce3;hp=d1033213781eecf2dbd78f088b03845c5c13c085;hb=324c3b05da99cf3c15014f16caea6f882d7f488c;hpb=d8b6dda417667abf7f0dfc976a60ecfe9bbb2aaf diff --git a/zlib/uncompr.c b/zlib/uncompr.c index d1033213781..8519d9bfaf8 100644 --- a/zlib/uncompr.c +++ b/zlib/uncompr.c @@ -1,10 +1,11 @@ /* uncompr.c -- decompress a memory buffer - * Copyright (C) 1995-1998 Jean-loup Gailly. - * For conditions of distribution and use, see copyright notice in zlib.h + * Copyright (C) 1995-2003 Jean-loup Gailly. + * For conditions of distribution and use, see copyright notice in zlib.h */ -/* @(#) $Id$ */ +/* @(#) $Id: uncompr.c,v 1.1.1.2 2002/03/11 21:53:27 tromey Exp $ */ +#define ZLIB_INTERNAL #include "zlib.h" /* =========================================================================== @@ -49,7 +50,9 @@ int ZEXPORT uncompress (dest, destLen, source, sourceLen) err = inflate(&stream, Z_FINISH); if (err != Z_STREAM_END) { inflateEnd(&stream); - return err == Z_OK ? Z_BUF_ERROR : err; + if (err == Z_NEED_DICT || (err == Z_BUF_ERROR && stream.avail_in == 0)) + return Z_DATA_ERROR; + return err; } *destLen = stream.total_out;