return NULL;
bytes = strlen(buffer) + 1;
- buf = xmalloc(*size);
+ buf = xmalloc(1+*size);
memcpy(buf, buffer + bytes, stream.total_out - bytes);
bytes = stream.total_out - bytes;
while (inflate(&stream, Z_FINISH) == Z_OK)
/* nothing */;
}
+ buf[*size] = 0;
inflateEnd(&stream);
return buf;
}