Update cctools-ld64-cygwin-buildfix.patch

This commit is contained in:
Thomas Pöchtrager 2016-09-22 20:22:43 +02:00
parent 33b64c1121
commit 3536634878

View File

@ -37,10 +37,12 @@ diff --git usage_examples/ios_toolchain/wrapper.c usage_examples/ios_toolchain/w
index c102d79..b88d35a 100644 index c102d79..b88d35a 100644
--- usage_examples/ios_toolchain/wrapper.c --- usage_examples/ios_toolchain/wrapper.c
+++ usage_examples/ios_toolchain/wrapper.c +++ usage_examples/ios_toolchain/wrapper.c
@@ -86,6 +86,7 @@ char *get_executable_path(char *epath, size_t buflen) @@ -85,7 +85,8 @@ char *get_executable_path(char *epath, size_t buflen)
if (!ok) return NULL;
l = strlen(epath); l = strlen(epath);
#else #else
ssize_t l = readlink("/proc/self/exe", epath, buflen); - ssize_t l = readlink("/proc/self/exe", epath, buflen);
+ ssize_t l = readlink("/proc/self/exe", epath, buflen - 1);
+ if (l > 0) epath[l] = '\0'; + if (l > 0) epath[l] = '\0';
#endif #endif
if (l <= 0) return NULL; if (l <= 0) return NULL;