[xml] sprintf and xmlChar



Hi

Quick Question:

Can something go awry, if i do the following:

xmlChar *value, *string;
...
value = (xmlChar*) malloc (sizeof(xmlChar *) * (xmlStrlen(string) + 3));
sprintf(value, "\"%s\"", string);
...

or is there a better way of surrounding a xmlChar with " and " (or any
other character...). And can I use sprintf for xmlChar? Maybe I didn't see
something obvious, which would forbid that...

TIA

christian





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]