summaryrefslogtreecommitdiff
path: root/gzwrite.c
AgeCommit message (Collapse)Author
2020-09-14Allocate gzlib/gzread/gzwrite structs and in/out buffers using zng_allocHans Kristian Rosbach
instead of malloc, this also enforces data alignment.
2020-08-31Rename ZEXPORT and ZEXTERN for consistency.Nathan Moinvaziri
2020-08-23Reintroduce support for ZLIB_CONST in compat mode. (#704)Mika Lindqvist
* Reintroduce support for ZLIB_CONST in compat mode.
2019-10-22Avoid adding empty gzip member after gzflush with Z_FINISH.Mark Adler
2019-07-18Fixed use of uninitialized value found by memory sanitizer and reported by ↵Nathan Moinvaziri
@sebpop.
2019-01-15Return an error if the gzputs string length can't fit in an int.Mark Adler
2018-12-13Avoid undefined behaviors of memcpy() in gz*printf().Mark Adler
2018-12-13Make the names in functions declarations identical to definitions.Mark Adler
2018-09-17Fix ZLIB_COMPAT=OFF and WITH_GZFILEOP=ON compilation failure.Hans Kristian Rosbach
Also add this combination to travis testing. Remove --native testing from travis, since they somehow make this fail very often, probably due to caching or running the executables on a different platform than the compiler thinks it is running on.
2018-03-22Move private defines from zconf.h and zconf-ng.h to zbuild.hMika Lindqvist
* move definition of z_size_t to zbuild.h
2018-01-31Adapt code to support PREFIX macros and update build scriptsMika Lindqvist
2018-01-31Add function prefix (zng_) to all exported functions to allow zlib-ngHans Kristian Rosbach
to co-exist in an application that has been linked to something that depends on stock zlib. Previously, that would cause random problems since there is no way to guarantee what zlib version is being used for each dynamically linked function. Add the corresponding zlib-ng.h. Tests, example and minigzip will not compile before they have been adapted to use the correct functions as well. Either duplicate them, so we have minigzip-ng.c for example, or add compile-time detection in the source code.
2017-03-24Prevent potential division-by-zero in gzfwrite and gzfread.Hans Kristian Rosbach
2017-02-25Type cleanup...Mika Lindqvist
* gz_statep -> gz_state *
2017-02-13Fix build with nmake.Mika Lindqvist
2017-02-13zlib 1.2.11Mark Adler
2017-02-09Fix bug in gzwrite.c that produced corrupt gzip files.Mark Adler
2017-02-09zlib 1.2.9Mark Adler
2017-02-07Avoid some random compiler warnings on various platforms.Mark Adler
2017-02-06Add gzfwrite(), duplicating the interface of fwrite().Mark Adler
2017-02-06Don't need to emit an empty fixed block when changing parameters.Mark Adler
gzsetparams() was using Z_PARTIAL_FLUSH when it could use Z_BLOCK instead. This commit uses Z_BLOCK, which avoids emitting an unnecessary ten bits into the stream.
2017-02-06Clean up gz* function return values.Mark Adler
In some cases the return values did not match the documentation, or the documentation did not document all of the return values. gzprintf() now consistently returns negative values on error, which matches the behavior of the stdio fprintf() function.
2017-02-02Explicitly ignore a return value in gzwrite.c.Mark Adler
2017-01-31Clean up type conversions.Mark Adler
Based on upstream 7096424f23df1b1813237fb5f8bc8f34cfcedd0c, but modified heavily to match zlib-ng.
2017-01-31Replace Z_NULL with NULL. Fix incorrect uses of NULL/Z_NULL.Mika Lindqvist
2017-01-30Revert "Loop on write() calls in gzwrite.c in case of non-blocking I/O."Hans Kristian Rosbach
This reverts commit 4811aa74806df01ac7e5a28c7a6b42bc6795b7a4. Reverted because the code returns incorrect data. Needs to be investigated and re-implemented.
2017-01-30local -> staticMika Lindqvist
* local -> static * Normalize and cleanup line-endings * Fix warnings under Visual Studio. * Whitespace cleanup *** This patch has been edited to merge cleanly and to exclude type changes. Based on 8d7a7c3b82c6e38734bd504dac800b148ab410d0 "Type Cleanup"
2016-04-27Loop on write() calls in gzwrite.c in case of non-blocking I/O.Mark Adler
2015-11-03Improve speed of gzprintf() in transparent mode.Mark Adler
A few minor modifications done to help with conflicts.
2015-11-03Avoid uninitialized access by gzclose_w().Mark Adler
(cherry picked from commit c901a34c92c4aa74028f541a9773df726ce2b769) Conflicts: deflate.c
2015-05-25Style cleanup for gzfile codeHans Kristian Rosbach
2015-05-17Kill Byte and BytefDaniel Axtens
Signed-off-by: Daniel Axtens <dja@axtens.net> Conflicts: adler32.c compress.c deflate.c inflate.c match.c test/example.c uncompr.c zlib.h
2015-05-13z_const -> constDaniel Axtens
Signed-off-by: Daniel Axtens <dja@axtens.net> Conflicts: arch/x86/crc_folding.c crc32.c
2015-05-12Convert remaining K&R function declarations to ANSI-C declarations.Hans Kristian Rosbach
2015-04-26Cleanup: Replace 'z_streamp' with 'z_stream *'Hans Kristian Rosbach
2015-04-26Cleanup: Replace 'voidpc' with 'void const *'Hans Kristian Rosbach
2014-10-18Rewrite K&R-style function prototypes to ANSI-C-style.hansr
Only internal functions, no exported functions in this commit.
2014-10-16Remove FAR variants of variables ushf, schf, Posf, Bytef, charf,hansr
intf, uIntf and uLongf
2014-10-12Remove workarounds for non-ANSI-C compatible compilers (Part 2)hansr
-Removing usage of OF() definition
2014-10-12Remove workarounds for non-ANSI-C compatible compilers (Part 1)hansr
2013-04-13Add casts in gzwrite.c for pointer differences.Mark Adler
2013-03-24zlib 1.2.7.1Mark Adler
2013-03-24Add casts and consts to ease user conversion to C++.Mark Adler
You would still need to run zlib2ansi on all of the *.c files.
2013-03-22Add gzvprintf() as an undocumented function in zlib.Mark Adler
The function is only available if stdarg.h is available.
2012-10-01Fix bug in gzclose() when gzwrite() runs out of memory.Mark Adler
If the deflateInit2() called for the first gzwrite() failed with a Z_MEM_ERROR, then a subsequent gzclose() would try to free an already freed pointer. This fixes that.
2012-09-29Fix bug where gzopen(), gzclose() would write an empty file.Mark Adler
A gzopen() to write (mode "w") followed immediately by a gzclose() would output an empty zero-length file. What it should do is write an empty gzip file, with the gzip header, empty deflate content, and gzip trailer totalling 20 bytes. This fixes it to do that.
2012-08-24Fix unintialized value bug in gzputc() introduced by const patches.Mark Adler
Avoid the use of an uninitialized value when the write buffers have not been initialized. A recent change to avoid the use of strm-> next_in in order to resolve some const conflicts added the use of state->in in its place. This patch avoids the use of state->in when it is not initialized. Nothing bad would actually happen, since two variables set to the same unintialized value are subtracted. However valgrind was rightly complaining. So this fixes that.
2012-08-13Clean up the usage of z_const and respect const usage within zlib.Mark Adler
This patch allows zlib to compile cleanly with the -Wcast-qual gcc warning enabled, but only if ZLIB_CONST is defined, which adds const to next_in and msg in z_stream and in the in_func prototype. A --const option is added to ./configure which adds -DZLIB_CONST to the compile flags, and adds -Wcast-qual to the compile flags when ZLIBGCCWARN is set in the environment.
2012-03-03Fix bug in gzclose_w() when gzwrite() fails to allocate memory.Mark Adler
2012-03-02Cast to char * in gzprintf to avoid warnings [Zinser].Mark Adler