aboutsummaryrefslogtreecommitdiff
path: root/sources/TZR_LoadResourceTyped.c
diff options
context:
space:
mode:
Diffstat (limited to 'sources/TZR_LoadResourceTyped.c')
-rw-r--r--sources/TZR_LoadResourceTyped.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sources/TZR_LoadResourceTyped.c b/sources/TZR_LoadResourceTyped.c
index 126737b..8a2c5ab 100644
--- a/sources/TZR_LoadResourceTyped.c
+++ b/sources/TZR_LoadResourceTyped.c
@@ -1,6 +1,8 @@
#include "TZR_resource.h"
#include "TZR_globals.h"
#include "drain.h"
+#include <SDL2/SDL_log.h>
+#include <errno.h>
#include <string.h>
#include <sys/stat.h>
@@ -13,7 +15,7 @@ TZR_LoadResourceTyped(TZR_ResourceType type, const char *path)
return i + 1;
FILE *const fp = fopen(path, "rb");
if (fp == NULL) {
- perror(path);
+ TZR_Log("%s: %s", path, strerror(errno));
return 0;
}
size_t size;
@@ -33,7 +35,7 @@ TZR_LoadResourceTyped(TZR_ResourceType type, const char *path)
res->path = malloc(path_len + 1);
res->mtime = 0;
if (res->path == NULL)
- perror("TZR_LoadResourceTyped");
+ TZR_Log("%s", strerror(errno));
else
strcpy(res->path, path);
return id;