Question

I'm parsing xml via libxml2 library. After updating Xcode to 5.1, I got warning that last parameter - length - is implicitly converted to int, while it's unsigned long. Here's function declaration:

XMLPUBFUN xmlNodePtr XMLCALL
    xmlNewCDataBlock(xmlDocPtr doc,
                     const xmlChar *content,
                     int len);

Is there any similar function that takes unsigned long values, because I don't know how big my data can be, and I want to process it safely.

Was it helpful?

Solution

There's no such function. libxml2's string manipulation functions use ints for string lengths and offsets, so text nodes longer than INT_MAX are not supported.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top