summaryrefslogtreecommitdiff
path: root/repo/system/elfutils/patches/musl-strndupa.patch
diff options
context:
space:
mode:
authordavidovski <david@davidovski.xyz>2022-05-04 23:52:30 +0100
committerdavidovski <david@davidovski.xyz>2022-05-04 23:52:30 +0100
commit739c65c54cb0e957df5e9b76f93fb02554e5cac3 (patch)
tree09ddfa0a342f3ea9de136cb50abdd79821bf1b53 /repo/system/elfutils/patches/musl-strndupa.patch
parent4c585ad54388285500fd18a6aaa516894e0f2c16 (diff)
moved everything to new file formatting
Diffstat (limited to 'repo/system/elfutils/patches/musl-strndupa.patch')
-rw-r--r--repo/system/elfutils/patches/musl-strndupa.patch18
1 files changed, 18 insertions, 0 deletions
diff --git a/repo/system/elfutils/patches/musl-strndupa.patch b/repo/system/elfutils/patches/musl-strndupa.patch
new file mode 100644
index 0000000..a520688
--- /dev/null
+++ b/repo/system/elfutils/patches/musl-strndupa.patch
@@ -0,0 +1,18 @@
+--- a/src/unstrip.c.orig 2017-04-27 14:26:26.000000000 +0000
++++ b/src/unstrip.c 2017-05-05 15:51:33.515154220 +0000
+@@ -56,6 +56,15 @@
+ # define _(str) gettext (str)
+ #endif
+
++#ifndef strndupa
++#define strndupa(s, n) \
++ (__extension__ ({const char *__in = (s); \
++ size_t __len = strnlen (__in, (n)) + 1; \
++ char *__out = (char *) alloca (__len); \
++ __out[__len-1] = '\0'; \
++ (char *) memcpy (__out, __in, __len-1);}))
++#endif
++
+ /* Name and version of program. */
+ ARGP_PROGRAM_VERSION_HOOK_DEF = print_version;
+