Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
nerrons
purr-data
Commits
1955610c
Commit
1955610c
authored
Jul 18, 2019
by
Albert Gräf
Browse files
Fix improper string access in pd_getdirname on Mac.
parent
e2b3cc4a
Changes
1
Hide whitespace changes
Inline
Side-by-side
pd/src/s_path.c
View file @
1955610c
...
...
@@ -848,9 +848,10 @@ t_symbol *pd_getdirname(void)
buf
[
len
]
=
'\0'
;
sys_unbashfilename
(
buf
,
buf
);
#elif defined(__APPLE__)
len
=
sizeof
(
buf
);
_NSGetExecutablePath
(
buf
,
&
len
);
if
(
len
!=
-
1
)
buf
[
len
]
=
'\0'
;
int
ret
;
len
=
sizeof
(
buf
);
buf
[
0
]
=
'\0'
;
ret
=
_NSGetExecutablePath
(
buf
,
&
len
);
if
(
ret
)
len
=
-
1
;
#elif defined(__FreeBSD__)
len
=
(
ssize_t
)(
readlink
(
"/proc/curproc/file"
,
buf
,
sizeof
(
buf
)
-
1
));
if
(
len
!=
-
1
)
buf
[
len
]
=
'\0'
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment