summaryrefslogtreecommitdiff
path: root/xmlstring.c
diff options
context:
space:
mode:
authorMike Hommey <glandium@debian.org>2006-01-06 18:28:17 +0100
committerMike Hommey <glandium@debian.org>2006-01-06 18:28:17 +0100
commit0fd83af441e251fc23fc1af7959fd6ecfa105fe1 (patch)
treea2b35749a66abce02e6f07983ef50618d93bef58 /xmlstring.c
parent17049f05f9ef09b3dc2a9c5d1de3f21de7c03193 (diff)
downloadlibxml2-0fd83af441e251fc23fc1af7959fd6ecfa105fe1.tar.gz
Load /tmp/tmp.U9vXwU/libxml2-2.6.23 intoupstream/2.6.23
local/libxml2/branches/upstream/current.
Diffstat (limited to 'xmlstring.c')
-rw-r--r--xmlstring.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/xmlstring.c b/xmlstring.c
index 67a20b9..4f3b373 100644
--- a/xmlstring.c
+++ b/xmlstring.c
@@ -147,8 +147,8 @@ xmlStrcmp(const xmlChar *str1, const xmlChar *str2) {
* @str1: the first xmlChar *
* @str2: the second xmlChar *
*
- * Check if both string are equal of have same content
- * Should be a bit more readable and faster than xmlStrEqual()
+ * Check if both strings are equal of have same content.
+ * Should be a bit more readable and faster than xmlStrcmp()
*
* Returns 1 if they are equal, 0 if they are different
*/
@@ -437,7 +437,8 @@ xmlStrlen(const xmlChar *str) {
* @len: the length of @add
*
* a strncat for array of xmlChar's, it will extend @cur with the len
- * first bytes of @add.
+ * first bytes of @add. Note that if @len < 0 then this is an API error
+ * and NULL will be returned.
*
* Returns a new xmlChar *, the original @cur is reallocated if needed
* and should not be freed
@@ -450,6 +451,8 @@ xmlStrncat(xmlChar *cur, const xmlChar *add, int len) {
if ((add == NULL) || (len == 0))
return(cur);
+ if (len < 0)
+ return(NULL);
if (cur == NULL)
return(xmlStrndup(add, len));
@@ -468,10 +471,11 @@ xmlStrncat(xmlChar *cur, const xmlChar *add, int len) {
* xmlStrncatNew:
* @str1: first xmlChar string
* @str2: second xmlChar string
- * @len: the len of @str2
+ * @len: the len of @str2 or < 0
*
* same as xmlStrncat, but creates a new string. The original
- * two strings are not freed.
+ * two strings are not freed. If @len is < 0 then the length
+ * will be calculated automatically.
*
* Returns a new xmlChar * or NULL
*/