HEX
Server: Apache/2.4.41 (FreeBSD) OpenSSL/1.0.2s mod_fcgid/2.3.9
System: FreeBSD salazo 12.0-RELEASE-p1303-ZFS hostBSD 12.0-RELEASE-p1303-ZFS DMR amd64
User: admin (1000)
PHP: 7.4.3
Disabled: NONE
Upload Files
File: /usr/ports/sysutils/squashfs-tools/files/patch-action.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
  */