Created
August 13, 2010 00:45
-
-
Save mattn/522038 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/cpans.c b/cpans.c | |
index e3998ca..ef1f2e5 100644 | |
--- a/cpans.c | |
+++ b/cpans.c | |
@@ -30,8 +30,8 @@ void slist_transform( const char * url , const char * sourcefile ) | |
char datafile[128]; | |
cpansearch_datafile( datafile ); | |
- FILE *in = fopen( sourcefile , "r" ); | |
- FILE *out = fopen( datafile , "w+" ); | |
+ FILE *in = fopen( sourcefile , "rb" ); | |
+ FILE *out = fopen( datafile , "wb+" ); | |
char buffer[300]; | |
int i; | |
@@ -93,7 +93,7 @@ char * slist_url() | |
char url[300]; | |
cpansearch_datafile( datafile ); | |
- in = fopen (datafile, "r+"); | |
+ in = fopen (datafile, "rb+"); | |
assert( in != NULL ); | |
fread( url , 1 , 300 , in ); | |
@@ -180,7 +180,7 @@ int search(const char * pattern) | |
cpansearch_datafile( datafile ); | |
- in = fopen (datafile, "r+"); | |
+ in = fopen (datafile, "rb+"); | |
assert( in != NULL ); | |
char url[300]; | |
diff --git a/membuf.c b/membuf.c | |
index dd13eb1..ab82735 100644 | |
--- a/membuf.c | |
+++ b/membuf.c | |
@@ -72,7 +72,7 @@ void membuf_writefile( membuf * mbuf , const char * file ) | |
FILE *fp; | |
int idx = 0; | |
- fp = fopen( file , "w" ); | |
+ fp = fopen( file , "wb" ); | |
assert( fp != NULL ); | |
while( idx < mbuf->index ) { | |
diff --git a/membuf.o b/membuf.o | |
deleted file mode 100644 | |
index c2f16d6..0000000 | |
Binary files a/membuf.o and /dev/null differ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment