Skip to content

Commit ea5a9a8

Browse files
authored
Merge pull request #182 from herwinw/jeload_move_len_variable
Move len variable in jeload.cpp
2 parents 09ab377 + 919d67c commit ea5a9a8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

jsrc/jeload.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ jeload(void* callbacks) -> J {
9797
auto
9898
jepath(char* arg, char* lib) -> void {
9999
uint32_t const sz = 4000;
100-
uint32_t len = sz; // Cant be const for function call _NSGetExecutablePath
101100

102101
// C strings need to be used for POSIX APIs and macOS APIs
103102
auto arg2 = new char[sz];
@@ -109,6 +108,7 @@ jepath(char* arg, char* lib) -> void {
109108
// try host dependent way to get path to executable
110109
// use arg if they fail (arg command in PATH won't work)
111110
#ifdef __MACH__
111+
uint32_t len = sz; // Cant be const for function call _NSGetExecutablePath
112112
// Returns 0 if path was copied, otherwise -1 if failed.
113113
if (_NSGetExecutablePath(arg2, &len) != 0) strcat(arg2, arg);
114114
#else

0 commit comments

Comments
 (0)