gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r6833 - Extractor/src/plugins


From: gnunet
Subject: [GNUnet-SVN] r6833 - Extractor/src/plugins
Date: Sun, 18 May 2008 07:01:55 -0600 (MDT)

Author: holindho
Date: 2008-05-18 07:01:54 -0600 (Sun, 18 May 2008)
New Revision: 6833

Modified:
   Extractor/src/plugins/flacextractor.c
Log:
no strndup on OS X


Modified: Extractor/src/plugins/flacextractor.c
===================================================================
--- Extractor/src/plugins/flacextractor.c       2008-05-17 22:59:44 UTC (rev 
6832)
+++ Extractor/src/plugins/flacextractor.c       2008-05-18 13:01:54 UTC (rev 
6833)
@@ -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 @@
                             type,
                             type_length)) )
        return addKeyword(tmap[i].type,
-                         strndup(value,
+                         xstrndup(value,
                                  value_length),
                          prev);
       i++;





reply via email to

[Prev in Thread] Current Thread [Next in Thread]