// https://www.securityfocus.com/archive/1/312869 --- originally by Richard Kettlewell
#include <stdlib.h>
#include <zlib.h>
#include <errno.h>
#include <stdio.h>

int main(void) {
    gzFile f;
    int ret;

    if(!(f = gzopen("/dev/null", "w"))) {
        perror("/dev/null");
        exit(1);
    }

    ret = gzprintf(f, "%10240s", "");
    printf("gzprintf -> %d\n", ret);
    ret = gzclose(f);
    printf("gzclose -> %d [%d]\n", ret, errno);

    exit(0);
}
