X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FMac-NSGetExecutablePath.git;a=blobdiff_plain;f=NSGetExecutablePath.xs;h=152a70d21e9f12897ecd998da90b86b36cf925a2;hp=93ba9a301e11539cf01a67680bd70ac91e95881f;hb=HEAD;hpb=180647c780dba17e20b7fe68103d8032f37c697e diff --git a/NSGetExecutablePath.xs b/NSGetExecutablePath.xs index 93ba9a3..152a70d 100644 --- a/NSGetExecutablePath.xs +++ b/NSGetExecutablePath.xs @@ -8,7 +8,6 @@ #include - static const char nsgep_too_long[] = "NSGetExecutablePath() wants to return a path too large"; /* --- XS ------------------------------------------------------------------ */ @@ -34,7 +33,8 @@ PPCODE: 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);