From 969152b902322a3eb34d74a9d96775f0df9bfbda Mon Sep 17 00:00:00 2001 From: twinaphex Date: Wed, 18 Mar 2015 05:29:06 +0100 Subject: [PATCH] (file_ops.c) read_generic_file - set len to -1 in case of an error --- file_ops.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/file_ops.c b/file_ops.c index 8bbaf2aee1..0bb393ccf2 100644 --- a/file_ops.c +++ b/file_ops.c @@ -134,6 +134,8 @@ error: fclose(file); if (rom_buf) free(rom_buf); + if (len) + *len = -1; *buf = NULL; return false; } @@ -238,6 +240,5 @@ int read_file(const char *path, void **buf, ssize_t *length) #endif if (read_generic_file(path, buf, length)) return 1; - *length = -1; return 0; }