void-packages/srcpkgs/fwupdate/patches/musl-strndupa.patch
2018-03-17 21:52:14 -07:00

18 lines
548 B
Diff

--- linux/libfwup.c
+++ linux/libfwup.c
@@ -30,6 +30,15 @@
#include "ucs2.h"
#include "fwup-efi.h"
+#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
+
static int verbose;
#include "error.h"