mirror of
https://github.com/visualboyadvance-m/visualboyadvance-m
synced 2025-10-05 23:52:49 +02:00
Fix glibc crash: add log message on fopen failure
glibc's fclose implementation does not do a NULL check and will crash on "fclose(NULL)". A bunch of Fedora users have been sending in traces for this issue. I've added a log on failure case, likely if the user does not have permission to write to the file.
This commit is contained in:
committed by
Rafael Kitover
parent
b59b7b394c
commit
1ba2eefebe
@@ -758,6 +758,10 @@ void SaveConfigFile()
|
||||
if (configFile != NULL)
|
||||
{
|
||||
FILE *f = fopen(configFile, "w");
|
||||
if (f == NULL) {
|
||||
log("Configuration file could not be opened %s\n", optarg);
|
||||
return;
|
||||
}
|
||||
// Needs mixed case version of the option name to add new options into the ini
|
||||
//for (int i = 0; i < (sizeof(argOptions) / sizeof(option)); i++)
|
||||
//{
|
||||
|
Reference in New Issue
Block a user