termux-packages/packages/libelf/unstrip.c.patch

17 lines
547 B
Diff
Raw Normal View History

2016-05-04 21:31:11 +02:00
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);
2017-12-10 01:21:26 +01:00
+ size_t substr_len = lastslash - path;
2016-05-04 21:31:11 +02:00
+ 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);