rendered paste body char *path = malloc(sizeof(current->name) + sizeof("C:\\Dev-Cpp\\projects\\deMoNG\\extracted\\")); *path = '\0'; strcpy(path, "C:\\Dev-Cpp\\projects\\deMoNG\\extracted\\"); //strcat(path, current->name); //FILE *dest = fopen(path, "wb"); FILE *dest = fopen(current->name, "wb"); //char buffer2[] = { 'x' , 'y' , 'z' }; //fwrite (buffer2, sizeof(buffer2[0]) , sizeof(buffer2) , dest); //printf("%s\t%x\n", path, dest); system("PAUSE"); fseek(handle, current->offset, SEEK_SET); int ret; unsigned have; z_stream strm; unsigned char in[CHUNK]; unsigned char out[CHUNK]; /* allocate inflate state */ strm.zalloc = Z_NULL; strm.zfree = Z_NULL; strm.opaque = Z_NULL; strm.avail_in = 0; strm.next_in = Z_NULL; ret = inflateInit(&strm); if (ret != Z_OK) { fprintf(stderr, "Failed to initialise zlib"); return 1; }