fopen() should use binary mode (issue 70)

git-svn-id: https://tesseract-ocr.googlecode.com/svn/trunk@704 d0cd1f9f-072b-0410-8dd7-cf729c803f20
This commit is contained in:
zdenop@gmail.com 2012-03-11 12:41:17 +00:00
parent 87e03edb3a
commit 1009a6e2f0
3 changed files with 3 additions and 3 deletions

View File

@ -195,7 +195,7 @@ void Dict::go_deeper_dawg_fxn(
strcmp(output_ambig_words_file.string(), "") != 0) {
if (output_ambig_words_file_ == NULL) {
output_ambig_words_file_ =
fopen(output_ambig_words_file.string(), "w+");
fopen(output_ambig_words_file.string(), "wb+");
if (output_ambig_words_file_ == NULL) {
tprintf("Failed to open output_ambig_words_file %s\n",
output_ambig_words_file.string());

View File

@ -58,7 +58,7 @@ int main(int argc, char** argv) {
api.Init(tessdata_dir, lang.string(), tesseract::OEM_TESSERACT_ONLY,
NULL, NULL, &vars_vec, &vars_values, false);
tesseract::Dict &dict = api.tesseract()->getDict();
FILE *input_file = fopen(input_file_str, "r");
FILE *input_file = fopen(input_file_str, "rb");
if (input_file == NULL) {
tprintf("Failed to open input wordlist file %s\n", input_file_str);
exit(1);

View File

@ -54,7 +54,7 @@ class WordOutputter {
int WriteDawgAsWordlist(const UNICHARSET &unicharset,
const tesseract::Dawg *dawg,
const char *outfile_name) {
FILE *out = fopen(outfile_name, "w");
FILE *out = fopen(outfile_name, "wb");
if (out == NULL) {
tprintf("Could not open %s for writing.\n", outfile_name);
return 1;