[Libvir] [PATCH] Readd buffer errors & some cleanups

This readds some error checking of the returns from virBuffer* functions, removes need for is_blank (a _GNU_SOURCE extension), and a couple of other very minor cleanups. 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

On Tue, Jul 03, 2007 at 11:47:20AM +0100, Richard W.M. Jones wrote:
This readds some error checking of the returns from virBuffer* functions, removes need for is_blank (a _GNU_SOURCE extension), and a couple of other very minor cleanups.
Looks fine to me Dan. -- |=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=| |=- Perl modules: http://search.cpan.org/~danberr/ -=| |=- Projects: http://freshmeat.net/~danielpb/ -=| |=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=|

On Tue, Jul 03, 2007 at 11:47:20AM +0100, Richard W.M. Jones wrote:
This readds some error checking of the returns from virBuffer* functions, removes need for is_blank (a _GNU_SOURCE extension), and a couple of other very minor cleanups.
Looks fine to me, I just wonder about: - while (p && *p && isblank((unsigned char) *p)) + while (p && *p && (*p == ' ' || *p == '\t')) I don't think we have support for multiline commands so this should be fine, but '\n' and '\r' could be tested too. in any case +1 Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ veillard@redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/

Daniel Veillard wrote:
On Tue, Jul 03, 2007 at 11:47:20AM +0100, Richard W.M. Jones wrote:
This readds some error checking of the returns from virBuffer* functions, removes need for is_blank (a _GNU_SOURCE extension), and a couple of other very minor cleanups.
Looks fine to me, I just wonder about:
- while (p && *p && isblank((unsigned char) *p)) + while (p && *p && (*p == ' ' || *p == '\t'))
I don't think we have support for multiline commands so this should be fine, but '\n' and '\r' could be tested too.
in any case +1
isblank is defined as "a space or a tab" [from the man page], hence the substitution above. I'll apply the patch. 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

On Wed, Jul 04, 2007 at 10:11:19AM +0100, Richard W.M. Jones wrote:
Daniel Veillard wrote:
On Tue, Jul 03, 2007 at 11:47:20AM +0100, Richard W.M. Jones wrote:
This readds some error checking of the returns from virBuffer* functions, removes need for is_blank (a _GNU_SOURCE extension), and a couple of other very minor cleanups.
Looks fine to me, I just wonder about:
- while (p && *p && isblank((unsigned char) *p)) + while (p && *p && (*p == ' ' || *p == '\t'))
I don't think we have support for multiline commands so this should be fine, but '\n' and '\r' could be tested too.
in any case +1
isblank is defined as "a space or a tab" [from the man page], hence the substitution above.
oh, confused with isspace, and in XML terminology blanks includes end of line characters :-) Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ veillard@redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
participants (3)
-
Daniel P. Berrange
-
Daniel Veillard
-
Richard W.M. Jones