diff options
-rw-r--r-- | libxslt/functions.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libxslt/functions.c b/libxslt/functions.c index c754994e..dc619945 100644 --- a/libxslt/functions.c +++ b/libxslt/functions.c @@ -660,6 +660,7 @@ xsltFormatNumberFunction(xmlXPathParserContextPtr ctxt, int nargs) */ void xsltGenerateIdFunction(xmlXPathParserContextPtr ctxt, int nargs){ + static char base_address; xmlNodePtr cur = NULL; xmlXPathObjectPtr obj = NULL; long val; @@ -716,7 +717,7 @@ xsltGenerateIdFunction(xmlXPathParserContextPtr ctxt, int nargs){ if (obj) xmlXPathFreeObject(obj); - val = (long)((char *)cur - (char *)doc); + val = (long)((char *)cur - (char *)&base_address); if (val >= 0) { sprintf((char *)str, "idp%ld", val); } else { |