Fixed crash when file can't be opened
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@445
This commit is contained in:
parent
778a243f8d
commit
845e239eba
1 changed files with 8 additions and 2 deletions
|
@ -182,14 +182,20 @@ void CONFIG::Run(void) {
|
|||
FILE * f;
|
||||
if (cmd->FindString("-writeconf",temp_line,true)) {
|
||||
f=fopen(temp_line.c_str(),"wb+");
|
||||
if (!f) WriteOut(MSG_Get("PROGRAM_CONFIG_FILE_ERROR"),temp_line.c_str());
|
||||
if (!f) {
|
||||
WriteOut(MSG_Get("PROGRAM_CONFIG_FILE_ERROR"),temp_line.c_str());
|
||||
return;
|
||||
}
|
||||
fclose(f);
|
||||
control->PrintConfig(temp_line.c_str());
|
||||
return;
|
||||
}
|
||||
if (cmd->FindString("-writelang",temp_line,true)) {
|
||||
f=fopen(temp_line.c_str(),"wb+");
|
||||
if (!f) WriteOut(MSG_Get("PROGRAM_CONFIG_FILE_ERROR"),temp_line.c_str());
|
||||
if (!f) {
|
||||
WriteOut(MSG_Get("PROGRAM_CONFIG_FILE_ERROR"),temp_line.c_str());
|
||||
return;
|
||||
}
|
||||
fclose(f);
|
||||
MSG_Write(temp_line.c_str());
|
||||
return;
|
||||
|
|
Loading…
Add table
Reference in a new issue