We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 27a5908 commit 09976e6Copy full SHA for 09976e6
src/ccmain/control.cpp
@@ -128,8 +128,12 @@ bool Tesseract::ProcessTargetWord(const TBOX& word_box,
128
if (backup_config_file_ == nullptr) {
129
backup_config_file_ = kBackUpConfigFile;
130
FILE* config_fp = fopen(backup_config_file_, "wb");
131
- ParamUtils::PrintParams(config_fp, params());
132
- fclose(config_fp);
+ if (config_fp == nullptr) {
+ tprintf("Error, failed to open file \"%s\"\n", backup_config_file_);
133
+ } else {
134
+ ParamUtils::PrintParams(config_fp, params());
135
+ fclose(config_fp);
136
+ }
137
ParamUtils::ReadParamsFile(word_config,
138
SET_PARAM_CONSTRAINT_DEBUG_ONLY,
139
params());
0 commit comments