Skip to content

Commit 5096ad2

Browse files
fix(driver): missing dirname() on macOS
Signed-off-by: Coelacanthus <uwu@coelacanthus.name>
1 parent 5b3633a commit 5096ad2

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

driver/euicc-driver-loader.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,10 @@ static char *get_origin() {
109109
static char *get_origin() {
110110
char *buf = (char *)calloc(PATH_MAX, sizeof(char));
111111
uint32_t size = PATH_MAX;
112-
if (_NSGetExecutablePath(buf, &size) == 0) {
113-
return buf;
114-
} else {
112+
if (_NSGetExecutablePath(buf, &size) != 0) {
115113
return NULL;
116114
}
115+
return strdup(dirname(buf));
117116
}
118117
#endif
119118

0 commit comments

Comments
 (0)