+2006-06-12 Dan Winship <danw@novell.com>
+
+ * libsoup/soup-xmlrpc-response.c (soup_xmlrpc_value_get_int,
+ soup_xmlrpc_value_get_double): Further fixes from Brent Smith.
+ #344458.
+ (soup_xmlrpc_value_get_boolean): Similar fix, plus actually set
+ the output parameter and make the return value match the other
+ get_* methods.
+
2006-06-09 Dan Winship <danw@novell.com>
* configure.in: Add tests for apache, output tests/httpd.conf
xmlNode *xml;
xmlChar *content;
char *tail;
+ gboolean ok;
xml = (xmlNode *) value;
/* FIXME this should be exactly one text node */
content = xmlNodeGetContent (xml);
*i = strtol ((char *)content, &tail, 10);
+ ok = (*tail == '\0');
xmlFree (content);
- if (*tail != '\0')
- return FALSE;
- else
- return TRUE;
+ return ok;
}
gboolean
-soup_xmlrpc_value_get_double (SoupXmlrpcValue *value, double *b)
+soup_xmlrpc_value_get_double (SoupXmlrpcValue *value, double *d)
{
xmlNode *xml;
xmlChar *content;
char *tail;
+ gboolean ok;
xml = (xmlNode *) value;
/* FIXME this should be exactly one text node */
content = xmlNodeGetContent (xml);
- *b = g_ascii_strtod ((char *)content, &tail);
+ *d = g_ascii_strtod ((char *)content, &tail);
+ ok = (*tail == '\0');
xmlFree (content);
- if (*tail != '\0')
- return FALSE;
- else
- return TRUE;
+ return ok;
}
gboolean
xmlNode *xml;
xmlChar *content;
char *tail;
+ gboolean ok;
int i;
xml = (xmlNode *) value;
content = xmlNodeGetContent (xml);
i = strtol ((char *)content, &tail, 10);
+ *b = (i == 1);
+ ok = (*tail == '\0');
xmlFree (content);
- if (*tail != '\0')
- return FALSE;
-
- if (i != 0 && i != 1)
- return FALSE;
- return i == 1;
+ return ok;
}
gboolean