pkgsrc-wip/shell-fm/patches/patch-ae

19 lines
413 B
Text

$NetBSD: patch-ae,v 1.1.1.1 2008/04/02 03:51:56 netcap Exp $
--- src/portability.c.orig 2008-04-02 05:17:27.000000000 +0200
+++ src/portability.c
@@ -0,0 +1,14 @@
+#include "config.h"
+#include <string.h>
+
+#ifndef HAVE_STRNDUP
+char *strndup(const char *str, size_t len)
+{
+ char *dup= (char *)malloc( len+1 );
+ if (dup) {
+ strncpy(dup,str,len);
+ dup[len]= '\0';
+ }
+ return dup;
+}
+#endif