zlib sets the return value to -1 to communicate errors, which won't work if the parameter type is 'char'. Also, one routine was missing. Source: http://www.zlib.net/manual.html