static void zzip_mem_entry_make(ZZIP_MEM_DISK* disk,
ZZIP_MEM_ENTRY* entry)
{
- FILE* file = fopen (entry->zz_name, "w");
+ FILE* file = fopen (entry->zz_name, "wb");
if (file) { zzip_mem_entry_pipe (disk, entry, file); fclose (file); }
perror (entry->zz_name);
if (status < EXIT_WARNINGS) status = EXIT_WARNINGS;
int argn;
FILE* disk;
- disk = fopen (argv[1], "r");
+ disk = fopen (argv[1], "rb");
if (! disk) {
perror(argv[1]);
return exitcode(errno);
done = EXIT_WARNINGS;
continue;
}
- if (extract) out = create_fopen(name, "w", 1);
+ if (extract) out = create_fopen(name, "wb", 1);
if (! out) {
if (errno != EISDIR) done = EXIT_ERRORS;
continue;
FNM_NOESCAPE|FNM_PATHNAME|FNM_PERIOD))
{
FILE* out = stdout;
- if (extract) out = create_fopen(name, "w", 1);
+ if (extract) out = create_fopen(name, "wb", 1);
if (! out) {
if (errno != EISDIR) done = EXIT_ERRORS;
continue;
{
char* name = zzip_mem_entry_to_name (entry);
FILE* out = stdout;
- if (extract) out = create_fopen(name, "w", 1);
+ if (extract) out = create_fopen(name, "wb", 1);
if (! out) {
if (errno != EISDIR) done = EXIT_ERRORS;
continue;
FNM_NOESCAPE|FNM_PATHNAME|FNM_PERIOD))
{
FILE* out = stdout;
- if (extract) out = create_fopen(name, "w", 1);
+ if (extract) out = create_fopen(name, "wb", 1);
if (! out) {
if (errno != EISDIR) done = EXIT_ERRORS;
continue;
static void unzzip_cat_file(ZZIP_DIR* disk, char* name, FILE* out)
{
- ZZIP_FILE* file = zzip_fopen(name, "r");
+ ZZIP_FILE* file = zzip_fopen(name, "rb");
if (file)
{
char buffer[1024]; int len;
{
char* name = entry->d_name;
FILE* out = stdout;
- if (extract) out = create_fopen(name, "w", 1);
+ if (extract) out = create_fopen(name, "wb", 1);
if (! out) {
if (errno != EISDIR) done = EXIT_ERRORS;
continue;
memcpy(mix_name, zip_name, zip_name_len);
mix_name[zip_name_len] = '/';
strcpy(mix_name + zip_name_len + 1, name);
- if (extract) out = create_fopen(name, "w", 1);
+ if (extract) out = create_fopen(name, "wb", 1);
if (! out) {
if (errno != EISDIR) done = EXIT_ERRORS;
continue;
{
char* name = entry.d_name;
FILE* out = stdout;
- if (extract) out = create_fopen(name, "w", 1);
+ if (extract) out = create_fopen(name, "wb", 1);
if (! out) {
DBG3("fopen' %s : %s", name, strerror(errno));
if (errno != EISDIR) done = EXIT_ERRORS;
FNM_NOESCAPE|FNM_PATHNAME|FNM_PERIOD))
{
FILE* out = stdout;
- if (extract) out = create_fopen(name, "w", 1);
+ if (extract) out = create_fopen(name, "wb", 1);
if (! out) {
DBG3("fopen. %s : %s", name, strerror(errno));
if (errno != EISDIR) done = EXIT_ERRORS;
int argn;
FILE* disk;
- disk = fopen (argv[1], "r");
+ disk = fopen (argv[1], "rb");
if (! disk) {
perror(argv[1]);
return exitcode(errno);