summaryrefslogtreecommitdiff
path: root/contrib/xml2/xpath.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/xml2/xpath.c')
-rw-r--r--contrib/xml2/xpath.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/contrib/xml2/xpath.c b/contrib/xml2/xpath.c
index a8b159ebff..655c5322cd 100644
--- a/contrib/xml2/xpath.c
+++ b/contrib/xml2/xpath.c
@@ -23,7 +23,6 @@
#include <libxml/xmlerror.h>
#include <libxml/parserInternals.h>
-
PG_MODULE_MAGIC;
/* exported for use by xslt_proc.c */
@@ -328,7 +327,7 @@ xpath_string(PG_FUNCTION_ARGS)
/* We could try casting to string using the libxml function? */
xpath = (xmlChar *) palloc(pathsize + 9);
- strncpy((char *) xpath, "string(", 7);
+ memcpy((char *) xpath, "string(", 7);
memcpy((char *) (xpath + 7), VARDATA(xpathsupp), pathsize);
xpath[pathsize + 7] = ')';
xpath[pathsize + 8] = '\0';