From 116ca67f28d454a31b9b6ef25bd4ae9df9c28f7a Mon Sep 17 00:00:00 2001 From: Josh Coalson Date: Tue, 14 Nov 2006 06:16:05 +0000 Subject: [PATCH] fix bug, need to open exported picture file in binary mode on win32 --- src/metaflac/operations_shorthand_picture.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/metaflac/operations_shorthand_picture.c b/src/metaflac/operations_shorthand_picture.c index 21cfeb46..22346398 100644 --- a/src/metaflac/operations_shorthand_picture.c +++ b/src/metaflac/operations_shorthand_picture.c @@ -25,7 +25,7 @@ #include "options.h" #include "utils.h" #include "FLAC/assert.h" -#include "share/grabbag.h" /* for grabbag__picture_parse_specification */ +#include "share/grabbag.h" /* for grabbag__picture_parse_specification() etc */ static FLAC__bool import_pic_from(const char *filename, FLAC__StreamMetadata **picture, const char *specification, FLAC__bool *needs_write); static FLAC__bool export_pic_to(const char *filename, const FLAC__StreamMetadata *picture, const char *pic_filename); @@ -150,9 +150,9 @@ FLAC__bool export_pic_to(const char *filename, const FLAC__StreamMetadata *pictu return false; } if(0 == strcmp(pic_filename, "-")) - f = stdout; + f = grabbag__file_get_binary_stdout(); else - f = fopen(pic_filename, "w"); + f = fopen(pic_filename, "wb"); if(0 == f) { fprintf(stderr, "%s: ERROR: can't open export file %s: %s\n", filename, pic_filename, strerror(errno));