opnsense-ports/filesystems/squashfs-tools/files/patch-action.c
Franco Fichtner a2caadc357 */*: sync with upstream
Taken from: FreeBSD
2024-11-07 11:56:40 +01:00

17 lines
394 B
C

Hack for lack of strdupa() in BSD libc
--- action.c.orig 2014-05-10 04:54:13 UTC
+++ action.c
@@ -44,6 +44,12 @@
#include "action.h"
#include "error.h"
+#ifndef strdupa
+#include <string.h> // required for str*()
+#include <stdlib.h> // required for alloca
+#define strdupa(foo) (strncpy( alloca( strlen(foo) + 1 ), foo, strlen( foo ) + 1 ))
+#endif
+
/*
* code to parse actions
*/