termux-packages/packages/libelf/unstrip.c.patch
Fredrik Fornwall 66aea0b5df libelf: Keep the libelf part of elfutils
While all of elfutils does not build with clang, the libelf part does
and is needed by ltrace. So keep libelf as a package and let it replace
elfutils for now.
2018-08-17 21:32:56 +02:00

17 lines
547 B
Diff

diff -u -r ../elfutils-0.166/src/unstrip.c ./src/unstrip.c
--- ../elfutils-0.166/src/unstrip.c 2016-01-12 07:49:19.000000000 -0500
+++ ./src/unstrip.c 2016-05-04 15:22:24.975567076 -0400
@@ -303,7 +304,11 @@
if (lastslash == path)
return;
- char *dir = strndupa (path, lastslash - path);
+ size_t substr_len = lastslash - path;
+ char *dir = alloca(substr_len+1);
+ strncpy(dir, path, substr_len);
+ dir[substr_len] = 0;
+
while (mkdir (dir, 0777) < 0 && errno != EEXIST)
if (errno == ENOENT)
make_directories (dir);