Skip to content

Commit

Permalink
djexec: trunc ret code to unsigned char
Browse files Browse the repository at this point in the history
  • Loading branch information
stsp committed Oct 26, 2024
1 parent 63ceb5e commit 8cf5c64
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/djdev64/djexec.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@

struct exec_info {
/* volatile because of longjmp() vs auto storage */
volatile unsigned short exit_code;
/* unsigned char to not clash with go64/dj64 errors */
volatile unsigned char exit_code;
jmp_buf exit_jmp;
};

Expand Down Expand Up @@ -61,7 +62,7 @@ int djdev64_exec(const char *path, unsigned flags, int argc, char **argv)
if (setjmp(ei.exit_jmp))
ret = ei.exit_code;
else
ret = (unsigned short)m(argc, argv);
ret = (unsigned char)m(argc, argv);
ae2(NULL, NULL);
out:
dlclose(dlobj);
Expand Down

0 comments on commit 8cf5c64

Please sign in to comment.