#include <mach-o/dyld.h>
-
static const char nsgep_too_long[] = "NSGetExecutablePath() wants to return a path too large";
/* --- XS ------------------------------------------------------------------ */
buffer = SvGROW(dst, size);
if (_NSGetExecutablePath(buffer, &size))
croak(nsgep_too_long);
- SvCUR_set(dst, size - 1);
+ if (size)
+ SvCUR_set(dst, size - 1);
SvPOK_on(dst);
XPUSHs(dst);
XSRETURN(1);