Skip to content

Commit 9fc1bb8

Browse files
committed
fixup!
1 parent 3b89282 commit 9fc1bb8

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

qjs.c

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -61,18 +61,13 @@ static char **qjs__argv;
6161
static BOOL is_standalone(const char *exe)
6262
{
6363
FILE *exe_f = fopen(exe, "rb");
64-
if (!exe_f) {
65-
perror(exe);
66-
exit(1);
67-
}
68-
if (fseek(exe_f, -trailer_size, SEEK_END) < 0) {
69-
exit(1);
70-
}
64+
if (!exe_f)
65+
return FALSE;
66+
if (fseek(exe_f, -trailer_size, SEEK_END) < 0)
67+
return FALSE;
7168
uint8_t buf[TRAILER_SIZE];
72-
if (fread(buf, 1, trailer_size, exe_f) != trailer_size) {
73-
perror("fread exe trailer");
74-
exit(1);
75-
}
69+
if (fread(buf, 1, trailer_size, exe_f) != trailer_size)
70+
return FALSE;
7671
fclose(exe_f);
7772

7873
return !memcmp(buf, trailer_magic, trailer_magic_size);

0 commit comments

Comments
 (0)