openbsd-ports/net/xmlrpc-c/patches/patch-src_xmlrpc_datetime_c
espie 31e4f1d7d2 xmlrpc C/C++ library, prereq for newer cmake.
Also, makes sense to take this code out, as some other stuff is bound
to want this at some point.

This library is incredibly sloppy engineering. Reasonably readable
code, looks sensible, but incredible lack of testing (doesn't even pass
its own testsuite on a stable release... and does a lot of things that
can't work outside of linux... makes you wonder who is actually using
this...)
2006-12-18 14:39:56 +00:00

25 lines
735 B
Plaintext

$OpenBSD: patch-src_xmlrpc_datetime_c,v 1.1.1.1 2006/12/18 14:39:56 espie Exp $
--- src/xmlrpc_datetime.c.orig Mon Dec 18 11:19:46 2006
+++ src/xmlrpc_datetime.c Mon Dec 18 12:06:13 2006
@@ -243,7 +243,11 @@ static void
restoreTimezone(const char * const oldTz) {
if (haveSetenv) {
- setenv("TZ", oldTz, 1);
+ if (oldTz) {
+ setenv("TZ", oldTz, 1);
+ } else {
+ unsetenv("TZ");
+ }
free((char*)oldTz);
}
}
@@ -389,6 +393,7 @@ parseDatetime(xmlrpc_env * const envP,
else {
struct tm brokenTime;
+ memset(&brokenTime, 0, sizeof(struct tm));
brokenTime.tm_sec = s;
brokenTime.tm_min = m;
brokenTime.tm_hour = h;