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

Re: [libvirt] [PATCH 1/2] virCommand: document behavior on no output



On 04/12/2010, at 8:28 AM, Eric Blake wrote:
> Option 1: This patch (all callers have to worry about NULL buffers,
> but checking for output is a simple pointer check).
> 
> Option 2: Guarantee that outbuf/errbuf are allocated, even if to
> the empty string.  Caller always has to free the result, and
> empty output check requires checking if *outbuf=='\0'.
> 
> Personally, I prefer option 2.  Thoughts?

2 seems safer.


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