aboutsummaryrefslogtreecommitdiffstats
path: root/cmdutils.c
diff options
context:
space:
mode:
authorRamiro Polla <ramiro.polla@gmail.com>2010-05-22 21:32:57 +0000
committerRamiro Polla <ramiro.polla@gmail.com>2010-05-22 21:32:57 +0000
commitc56e9e05abb5ddf612bf5404e1d7b2dab4bad6de (patch)
tree9f86218cd0efcc8c23291e209af58126048c22ed /cmdutils.c
parent80b39e1ca6e4711e2094c1a0f20a188e8751c941 (diff)
downloadffmpeg-c56e9e05abb5ddf612bf5404e1d7b2dab4bad6de.tar.gz
Open 2-pass logfile in binary mode for both reading and writing.
This fixes a regression on Windows introduced by r22769 in which the data read from the file was not properly zero terminated. The file was read as text, which caused the \r characters to be suppressed. Since the zero termination happens at the end of the buffer, and there was one byte less read per line, this caused the remaining space on the buffer to contain random data. Originally committed as revision 23251 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'cmdutils.c')
-rw-r--r--cmdutils.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/cmdutils.c b/cmdutils.c
index 80917c3a19..2349b7052e 100644
--- a/cmdutils.c
+++ b/cmdutils.c
@@ -641,7 +641,7 @@ int read_yesno(void)
int read_file(const char *filename, char **bufptr, size_t *size)
{
- FILE *f = fopen(filename, "r");
+ FILE *f = fopen(filename, "rb");
if (!f) {
fprintf(stderr, "Cannot read file '%s': %s\n", filename, strerror(errno));