summaryrefslogtreecommitdiff
path: root/plugins/mms
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/mms')
-rw-r--r--plugins/mms/libmms/uri.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/plugins/mms/libmms/uri.c b/plugins/mms/libmms/uri.c
index 6b6475eb..111ca128 100644
--- a/plugins/mms/libmms/uri.c
+++ b/plugins/mms/libmms/uri.c
@@ -26,6 +26,22 @@
#include "uri.h"
#include <string.h>
+#ifndef strndup
+# define strndup(s, n) ({\
+ char *out;\
+ char *c = memchr (s, n, 0);\
+ if (c) {\
+ out = strdup (s);\
+ }\
+ else {\
+ out = malloc (n+1);\
+ memcpy (out, s, n);\
+ out[n] = 0;\
+ }\
+ out;\
+})
+#endif
+
static void field_unescape (char *str);
static char* field_escape (char* str, unsigned char mask);