mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
Use the actual error number
According to the man page, fopen and fclose return the error number in the global variable errno. Fixes CID 350115 Signed-off-by: Robert C. Helling <helling@atdotde.de>
This commit is contained in:
parent
f370446236
commit
143da031ce
1 changed files with 2 additions and 1 deletions
|
@ -6,6 +6,7 @@
|
|||
#include "core/subsurface-string.h"
|
||||
#include "core/save-profiledata.h"
|
||||
#include "core/version.h"
|
||||
#include <errno.h>
|
||||
|
||||
static void put_int(struct membuffer *b, int val)
|
||||
{
|
||||
|
@ -257,7 +258,7 @@ int save_profiledata(const char *filename, const bool select_only)
|
|||
error = fclose(f);
|
||||
}
|
||||
if (error)
|
||||
report_error("Save failed (%s)", strerror(error));
|
||||
report_error("Save failed (%s)", strerror(errno));
|
||||
|
||||
free_buffer(&buf);
|
||||
return error;
|
||||
|
|
Loading…
Reference in a new issue