X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=gnulib-local%2Flib%2Flibxml%2Fxmlstring.c;h=a37220d7808b0db5530e7239e5b107aacde26cb4;hb=refs%2Fchanges%2F82%2F71082%2F1;hp=4f3b373918f4327aa992cd9df8a5e8a1e1199f28;hpb=5d61132f836323aaf2879e04abc9d4056db248a2;p=platform%2Fupstream%2Fgettext.git diff --git a/gnulib-local/lib/libxml/xmlstring.c b/gnulib-local/lib/libxml/xmlstring.c index 4f3b373..a37220d 100644 --- a/gnulib-local/lib/libxml/xmlstring.c +++ b/gnulib-local/lib/libxml/xmlstring.c @@ -3,7 +3,7 @@ * * This module provides various utility functions for manipulating * the xmlChar* type. All functions named xmlStr* have been moved here - * from the parser.c file (their original home). + * from the parser.c file (their original home). * * See Copyright for the status of this software. * @@ -40,7 +40,7 @@ xmlChar * xmlStrndup(const xmlChar *cur, int len) { xmlChar *ret; - + if ((cur == NULL) || (len < 0)) return(NULL); ret = (xmlChar *) xmlMallocAtomic((len + 1) * sizeof(xmlChar)); if (ret == NULL) { @@ -85,7 +85,7 @@ xmlChar * xmlCharStrndup(const char *cur, int len) { int i; xmlChar *ret; - + if ((cur == NULL) || (len < 0)) return(NULL); ret = (xmlChar *) xmlMallocAtomic((len + 1) * sizeof(xmlChar)); if (ret == NULL) { @@ -170,7 +170,7 @@ xmlStrEqual(const xmlChar *str1, const xmlChar *str2) { * @name: the localname of the QName * @str: the second xmlChar * * - * Check if a QName is Equal to a given string + * Check if a QName is Equal to a given string * * Returns 1 if they are equal, 0 if they are different */ @@ -340,7 +340,7 @@ xmlStrchr(const xmlChar *str, xmlChar val) { const xmlChar * xmlStrstr(const xmlChar *str, const xmlChar *val) { int n; - + if (str == NULL) return(NULL); if (val == NULL) return(NULL); n = xmlStrlen(val); @@ -366,9 +366,9 @@ xmlStrstr(const xmlChar *str, const xmlChar *val) { */ const xmlChar * -xmlStrcasestr(const xmlChar *str, xmlChar *val) { +xmlStrcasestr(const xmlChar *str, const xmlChar *val) { int n; - + if (str == NULL) return(NULL); if (val == NULL) return(NULL); n = xmlStrlen(val); @@ -396,7 +396,7 @@ xmlStrcasestr(const xmlChar *str, xmlChar *val) { xmlChar * xmlStrsub(const xmlChar *str, int start, int len) { int i; - + if (str == NULL) return(NULL); if (start < 0) return(NULL); if (len < 0) return(NULL); @@ -519,7 +519,7 @@ xmlStrcat(xmlChar *cur, const xmlChar *add) { const xmlChar *p = add; if (add == NULL) return(cur); - if (cur == NULL) + if (cur == NULL) return(xmlStrdup(add)); while (*p != 0) p++; /* non input consuming */ @@ -537,20 +537,20 @@ xmlStrcat(xmlChar *cur, const xmlChar *add) { * * Returns the number of characters written to @buf or -1 if an error occurs. */ -int XMLCDECL +int XMLCDECL xmlStrPrintf(xmlChar *buf, int len, const xmlChar *msg, ...) { va_list args; int ret; - + if((buf == NULL) || (msg == NULL)) { return(-1); } - + va_start(args, msg); ret = vsnprintf((char *) buf, len, (const char *) msg, args); va_end(args); buf[len - 1] = 0; /* be safe ! */ - + return(ret); } @@ -565,17 +565,17 @@ xmlStrPrintf(xmlChar *buf, int len, const xmlChar *msg, ...) { * * Returns the number of characters written to @buf or -1 if an error occurs. */ -int +int xmlStrVPrintf(xmlChar *buf, int len, const xmlChar *msg, va_list ap) { int ret; - + if((buf == NULL) || (msg == NULL)) { return(-1); } - + ret = vsnprintf((char *) buf, len, (const char *) msg, ap); buf[len - 1] = 0; /* be safe ! */ - + return(ret); } @@ -858,7 +858,7 @@ xmlChar * xmlUTF8Strndup(const xmlChar *utf, int len) { xmlChar *ret; int i; - + if ((utf == NULL) || (len < 0)) return(NULL); i = xmlUTF8Strsize(utf, len); ret = (xmlChar *) xmlMallocAtomic((i + 1) * sizeof(xmlChar));