patched incorrect handling of struct tm in XmlRpc::XmlRpcValue

This commit is contained in:
fgerlits 2004-12-13 21:45:41 +00:00
parent b9495ba094
commit 12e3b40235
11 changed files with 132 additions and 42 deletions

View file

@ -22,7 +22,7 @@
#
#
# Author : $Author: fgerlits $
# Version : $Revision: 1.4 $
# Version : $Revision: 1.5 $
# Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/tools/xmlrpc++/xmlrpc++-20040713/bin/Attic/install.sh,v $
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
@ -47,6 +47,7 @@ tar xfz $tar
cd xmlrpc++
patch -p1 < $etcdir/xmlrpc++-automake.patch
patch -p1 < $etcdir/uninitialised_XmlRpcSource_ssl_ssl.patch
patch -p1 < $etcdir/incorrect_XmlRpcValue_struct_tm_conversion.patch
sh autogen.sh --prefix=$installdir
make install

View file

@ -0,0 +1,31 @@
diff -Nur xmlrpc++/src/XmlRpcValue.cpp x/src/XmlRpcValue.cpp
--- xmlrpc++/src/XmlRpcValue.cpp 2003-06-06 20:13:28.000000000 +0200
+++ x/src/XmlRpcValue.cpp 2004-12-13 21:02:39.505001617 +0100
@@ -390,6 +390,7 @@
return false;
t.tm_year -= 1900;
+ t.tm_mon -= 1;
t.tm_isdst = -1;
_type = TypeDateTime;
_value.asTime = new struct tm(t);
@@ -402,7 +403,7 @@
struct tm* t = _value.asTime;
char buf[20];
snprintf(buf, sizeof(buf)-1, "%04d%02d%02dT%02d:%02d:%02d",
- 1900+t->tm_year,t->tm_mon,t->tm_mday,t->tm_hour,t->tm_min,t->tm_sec);
+ 1900+t->tm_year,1+t->tm_mon,t->tm_mday,t->tm_hour,t->tm_min,t->tm_sec);
buf[sizeof(buf)-1] = 0;
std::string xml = VALUE_TAG;
@@ -553,8 +554,8 @@
{
struct tm* t = _value.asTime;
char buf[20];
- snprintf(buf, sizeof(buf)-1, "%4d%02d%02dT%02d:%02d:%02d",
- t->tm_year,t->tm_mon,t->tm_mday,t->tm_hour,t->tm_min,t->tm_sec);
+ snprintf(buf, sizeof(buf)-1, "%04d%02d%02dT%02d:%02d:%02d",
+ 1900+t->tm_year,1+t->tm_mon,t->tm_mday,t->tm_hour,t->tm_min,t->tm_sec);
buf[sizeof(buf)-1] = 0;
os << buf;
break;