You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/dev-libs/elfutils/files/musl/elfutils-0.185-strndupa.patch

23 lines
802 B

Should be fixed in next release (0.186?).
https://sourceware.org/git/?p=elfutils.git;a=commit;h=e7e4c92650892cf67210be5ea89ffba967427cbf
https://git.alpinelinux.org/aports/plain/main/elfutils/musl-strndupa.patch
--- a/src/unstrip.c
+++ b/src/unstrip.c
@@ -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;