[libvirt] [PATCH v3] Fixed URI parsing

Daniel P. Berrange berrange at redhat.com
Fri Feb 24 20:57:50 UTC 2012


On Fri, Feb 24, 2012 at 07:09:49PM +0100, Martin Kletzander wrote:
> +xmlURIPtr
> +virURIParse(const char *uri)

> +unsigned char *
> +virURIFormat(xmlURIPtr uri)

The data types here are wrong compared to the header.

Also the return value should not be unsigned - that is
libxml2 bad practice we shouldn't copy

> diff --git a/src/util/viruri.h b/src/util/viruri.h
> new file mode 100644
> index 0000000..1315488
> --- /dev/null
> +++ b/src/util/viruri.h
> @@ -0,0 +1,18 @@
> +/*
> + * viruri.h: internal definitions used for URI parsing.
> + */
> +
> +#ifndef __VIR_URI_H__
> +# define __VIR_URI_H__
> +
> +# include <libxml/uri.h>
> +
> +# include "internal.h"
> +
> +typedef xmlURI    virURI;
> +typedef xmlURIPtr virURIPtr;
> +
> +virURIPtr        virURIParse(const char *uri);
> +unsigned char *  virURIFormat(virURIPtr uri);
> +
> +#endif /* __VIR_URI_H__ */


Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|




More information about the libvir-list mailing list