ports/converters/bsdconv/files/extra-patch-strndup
Martin Wilke c327817524 - Update to 3.5
PR:		139513 139525 139525
Submitted by:	Kuan-Chung Chiu <buganini@gmail.com> (maintainer)
2009-10-14 14:20:27 +00:00

25 lines
503 B
Text

--- src/bsdconv_func.c.orig 2009-10-11 19:26:58.000000000 +0800
+++ src/bsdconv_func.c 2009-10-14 21:30:50.000000000 +0800
@@ -25,6 +25,7 @@
#endif
#include <string.h>
#include "bsdconv.h"
+#include <stdlib.h>
int loadcodec(struct bsdconv_codec_t *cd, char *path, int maponly){
#ifdef WIN32
@@ -138,3 +139,14 @@
return r;
}
#endif
+
+char * strndup(const char *str, size_t len){
+ size_t l=strlen(str);
+ char *r;
+ if(len<l){
+ l=len;
+ }
+ r=malloc(l);
+ memcpy(r, str, l);
+ return r;
+}