From 78acdfa4cde044a7d532c8ca96d19ca0ffd2ae7c Mon Sep 17 00:00:00 2001 From: Daniel Veillard Date: Wed, 1 Aug 2001 08:39:03 +0000 Subject: [PATCH] one more revision on Norm's localTime() function Daniel * libxslt/extra.c: one more revision on Norm's localTime() function Daniel --- ChangeLog | 4 ++++ libxslt/extra.c | 12 ++++-------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8b294202..a283675f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Wed Aug 1 10:37:50 CEST 2001 Daniel Veillard + + * libxslt/extra.c: one more revision on Norm's localTime() function + Wed Aug 1 01:37:41 CEST 2001 Thomas Broyer * libexslt/sets.c: fixed bugs in exsltTrailingFunction and diff --git a/libxslt/extra.c b/libxslt/extra.c index b2463c55..fb035932 100644 --- a/libxslt/extra.c +++ b/libxslt/extra.c @@ -164,7 +164,7 @@ xsltFunctionLocalTime(xmlXPathParserContextPtr ctxt, int nargs) { xmlXPathObjectPtr obj; char *str; char digits[5]; - char result[17]; + char result[29]; long int field; time_t gmt, lmt; struct tm gmt_tm; @@ -254,13 +254,9 @@ xsltFunctionLocalTime(xmlXPathParserContextPtr ctxt, int nargs) { memset(result, 0, sizeof(result)); /* "Thu, 26 Jun 2001" */ /* 0123456789 12345 */ - strncpy(result, str, 3); - strcpy(result+3, ", "); - strncpy(result+5, str+8, 2); - strcpy(result+7, " "); - strncpy(result+8, str+4, 3); - strcpy(result+11, " "); - strncpy(result+12, str+20, 4); + strncpy(result, str, 20); + strcpy(result+20, "???"); /* tzname doesn't work, fake it */ + strncpy(result+23, str+19, 5); /* Ok, now result contains the string I want to send back. */ valuePush(ctxt, xmlXPathNewString((xmlChar *)result));