commit 103563c860cbbe79255199ddcd7732a4f71b99cb
parent 07417be9903bccf1700de6a55c34a0ad1cbc9002
Author: Heikki Lindholm <holin@iki.fi>
Date: Sun, 18 May 2008 13:01:54 +0000
no strndup on OS X
Diffstat:
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/src/plugins/flacextractor.c b/src/plugins/flacextractor.c
@@ -29,6 +29,15 @@
#error You must install the libflac header files!
#endif
+static char * xstrndup(const char * s, size_t n){
+ char * d;
+
+ d= malloc(n+1);
+ memcpy(d,s,n);
+ d[n]='\0';
+ return d;
+}
+
static struct EXTRACTOR_Keywords *
addKeyword (EXTRACTOR_KeywordType type,
char *keyword, struct EXTRACTOR_Keywords *next)
@@ -158,7 +167,7 @@ check(const char * type,
type,
type_length)) )
return addKeyword(tmap[i].type,
- strndup(value,
+ xstrndup(value,
value_length),
prev);
i++;