aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--xfile.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/xfile.h b/xfile.h
index 7c26e66..c915e28 100644
--- a/xfile.h
+++ b/xfile.h
@@ -90,8 +90,7 @@ static xFile xOpen(const char *path) {
lzma_ret ret = LZMA_OK;
const char *message, *tmp;
magic_t cookie;
- cookie = magic_open(MAGIC_NONE);
- if(!magic_load(cookie, NULL)) {
+ if ((cookie = magic_open(MAGIC_NONE)) && !magic_load(cookie, NULL)) {
message = magic_file(cookie, path);
if(message == NULL)
xF.type = XF_FAIL;