Browse Source
Merge pull request #363 from skullandbones/Issue-362_RPI4_no_bios.bin_v1
zxcc: Fix for load bios.bin failure on a RPi4
pull/367/head
Wayne Warthen
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
9 additions and
1 deletions
-
Tools/unix/zxcc/zxcc.c
|
|
|
@ -127,7 +127,15 @@ void load_bios(void) |
|
|
|
uint32_t size = CPM_MAXPATH - 8; |
|
|
|
_NSGetExecutablePath(dir, &size); |
|
|
|
#else |
|
|
|
readlink("/proc/self/exe", dir, CPM_MAXPATH - 8); /* allow room for bios.bin */ |
|
|
|
ssize_t len; |
|
|
|
len = readlink("/proc/self/exe", dir, CPM_MAXPATH - 8); /* allow room for bios.bin */ |
|
|
|
if (len < 0) |
|
|
|
{ |
|
|
|
/* len of -1 indicates an error occurred */ |
|
|
|
len = 0; |
|
|
|
} |
|
|
|
/* Terminate the dir string with a NUL character */ |
|
|
|
dir[len] = 0; |
|
|
|
#endif |
|
|
|
q = strrchr(dir, DIRSEPCH); |
|
|
|
*++q = 0; |
|
|
|
|