summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
2744092)
Apparently _NSGetExecutablePath doesn't actually set the len field in
the case of successfully copying a value to buf. In this case, the
value in buf is properly terminated, so we can just use strlen to find
a legal value to use when calling truncate.
#else
ssize_t len;
len = readlink("/proc/self/exe", buf, size - 1);
#else
ssize_t len;
len = readlink("/proc/self/exe", buf, size - 1);