diff options
author | martin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2011-02-18 09:02:35 +0000 |
---|---|---|
committer | martin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2011-02-18 09:02:35 +0000 |
commit | de09e179105ca45973e4b0c08d69fa8ff8f4e560 (patch) | |
tree | 19b01327b906f937b050d5d7f8e435cb33c76ead /navit/support/ezxml | |
parent | 60ef6409c84cecb4e3263916349840696e88cbcf (diff) | |
download | navit-de09e179105ca45973e4b0c08d69fa8ff8f4e560.tar.gz |
Fix:support_ezxml:Portability
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@4193 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'navit/support/ezxml')
-rw-r--r-- | navit/support/ezxml/ezxml.c | 9 | ||||
-rw-r--r-- | navit/support/ezxml/ezxml.h | 2 |
2 files changed, 7 insertions, 4 deletions
diff --git a/navit/support/ezxml/ezxml.c b/navit/support/ezxml/ezxml.c index 216afdd95..4ade3a5f2 100644 --- a/navit/support/ezxml/ezxml.c +++ b/navit/support/ezxml/ezxml.c @@ -38,6 +38,9 @@ #endif // EZXML_NOMMAP #include <sys/stat.h> #include "ezxml.h" +#ifdef HAVE_API_WIN32_CE +#include "libc.h" +#endif #define EZXML_WS "\t\r\n " // whitespace #define EZXML_ERRL 128 // maximum error string length @@ -147,7 +150,7 @@ ezxml_t ezxml_err(ezxml_root_t root, char *s, const char *err, ...) g_snprintf(fmt, EZXML_ERRL, "[error near line %d]: %s", line, err); va_start(ap, err); - vsnprintf(root->err, EZXML_ERRL, fmt, ap); + g_vsnprintf(root->err, EZXML_ERRL, fmt, ap); va_end(ap); return &root->xml; @@ -308,7 +311,7 @@ void ezxml_proc_inst(ezxml_root_t root, char *s, size_t len) root->pi[i] = malloc(sizeof(char *) * 3); root->pi[i][0] = target; root->pi[i][1] = (char *)(root->pi[i + 1] = NULL); // terminate pi list - root->pi[i][2] = strdup(""); // empty document position list + root->pi[i][2] = g_strdup(""); // empty document position list } while (root->pi[i][j]) j++; // find end of instruction list for this target @@ -929,7 +932,7 @@ ezxml_t ezxml_set_attr(ezxml_t xml, const char *name, const char *value) if (! value) return xml; // nothing to do if (xml->attr == EZXML_NIL) { // first attribute xml->attr = malloc(4 * sizeof(char *)); - xml->attr[1] = strdup(""); // empty list of malloced names/vals + xml->attr[1] = g_strdup(""); // empty list of malloced names/vals } else xml->attr = realloc(xml->attr, (l + 4) * sizeof(char *)); diff --git a/navit/support/ezxml/ezxml.h b/navit/support/ezxml/ezxml.h index 3e020788b..a0cb92ee5 100644 --- a/navit/support/ezxml/ezxml.h +++ b/navit/support/ezxml/ezxml.h @@ -142,7 +142,7 @@ ezxml_t ezxml_set_attr(ezxml_t xml, const char *name, const char *value); // Wrapper for ezxml_set_attr() that strdup()s name/value. Value cannot be NULL #define ezxml_set_attr_d(xml, name, value) \ - ezxml_set_attr(ezxml_set_flag(xml, EZXML_DUP), strdup(name), strdup(value)) + ezxml_set_attr(ezxml_set_flag(xml, EZXML_DUP), g_strdup(name), strdup(value)) // sets a flag for the given tag and returns the tag ezxml_t ezxml_set_flag(ezxml_t xml, short flag); |