diff options
Diffstat (limited to 'srcs/key_handler.c')
-rw-r--r-- | srcs/key_handler.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/srcs/key_handler.c b/srcs/key_handler.c index c5a2f95..b992799 100644 --- a/srcs/key_handler.c +++ b/srcs/key_handler.c @@ -157,7 +157,11 @@ static int _read_from_file(const char *path, raw_buffer_s **pdata) return WAE_ERROR_FILE; } - fseek(f, 0, SEEK_END); // move to the end of a file + if (fseek(f, 0, SEEK_END) != 0) { // move to the end of a file + WAE_SLOGE("Failed in fseek. file=%s", path); + ret = WAE_ERROR_FILE; + goto error; + } int file_len = ftell(f); if (file_len <= 0) { @@ -166,7 +170,11 @@ static int _read_from_file(const char *path, raw_buffer_s **pdata) goto error; } - fseek(f, 0, SEEK_SET); // move to the start of a file + if (fseek(f, 0, SEEK_SET) != 0) { // move to the start of a file + WAE_SLOGE("Failed in fseek. file=%s", path); + ret = WAE_ERROR_FILE; + goto error; + } data = buffer_create(file_len); if (data == NULL) { |