aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/scanner.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/scanner.c b/src/scanner.c
index 7ed1ba1..2b3adbd 100644
--- a/src/scanner.c
+++ b/src/scanner.c
@@ -975,6 +975,17 @@ verify_arguments(struct parse_context *ctx,
}
+#ifndef HAVE_STRNDUP
+char *
+strndup(const char *s, size_t size)
+{
+ char *r = malloc(size + 1);
+ strncpy(r, s, size);
+ r[size] = '\0';
+ return r;
+}
+#endif
+
static void
end_element(void *data, const XML_Char *name)
{