[Libvir] XML escaping patch

Richard W.M. Jones rjones at redhat.com
Fri Jul 6 14:05:09 UTC 2007


Daniel Veillard wrote:
[...]
>  /**
> + * virBufferEscapeString:
> + * @buf:  the buffer to dump
> + * @format: a printf like format string but with only one %s parameter
> + * @str:  the string argument which need to be escaped
> + *
> + * Do a formatted print with a single string to an XML buffer. The string
> + * is escaped to avoid generating a not well-formed XML instance.
> + *
> + * Returns 0 successful, -1 in case of internal or API error.
> + */
> +int
> +virBufferEscapeString(virBufferPtr buf, const char *format, const char *str)

I spent a bit of time pondering if it would be possible to either make 
this call type-safe, or else handle arbitrary format strings.  I'm not 
sure I can see a good way to do either, so in the meantime, +1.

Rich.

-- 
Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/
Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod
Street, Windsor, Berkshire, SL4 1TE, United Kingdom.  Registered in
England and Wales under Company Registration No. 03798903
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3237 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20070706/35b7f6b7/attachment-0001.bin>


More information about the libvir-list mailing list