Re: [PATCH v2 4/4] util: Check for negative indent in virBufferAdd

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

 



On 01/15/2013 07:12 PM, John Ferlan wrote:
> ---
>  src/util/virbuffer.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/src/util/virbuffer.c b/src/util/virbuffer.c
> index 969dcbf..693e4b2 100644
> --- a/src/util/virbuffer.c
> +++ b/src/util/virbuffer.c
> @@ -153,10 +153,9 @@ virBufferAdd(virBufferPtr buf, const char *str, int len)
>      if (!str || !buf || (len == 0 && buf->indent == 0))
>          return;
>  
> -    if (buf->error)
> -        return;
> -
>      indent = virBufferGetIndent(buf, true);
> +    if (indent < 0)
> +        return;
>  
>      if (len < 0)
>          len = strlen(str);
> 

ACK && Pushed with a little explanation taken from 0/4:

Since virBufferGetIndent() will check and fail on buf->error, I removed
that check from virBufferAdd() and used the -1 return as the way to exit.

Hope that's OK,

Martin

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]