Re: [PATCH 1/6] buf: support peeking at string contents

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

 



On 06/11/2012 06:05 AM, Peter Krempa wrote:
> On 06/09/12 06:34, Eric Blake wrote:
>> Right now, the only way to get at the contents of a virBuffer is
>> to destroy it.  But there are cases in my upcoming patches where
>> peeking at the contents makes life easier.  I suppose this does
>> open up the potential for bad code to dereference a stale pointer,
>> by disregarding the docs that the return value is invalid on the
>> next virBuf operation, but such is life.
>>
>> * src/util/buf.h (virBufferCurrentContent): New declaration.
>> * src/util/buf.c (virBufferCurrentContent): Implement it.
>> * src/libvirt_private.syms (buf.h): Export it.
>> * tests/virbuftest.c (testBufAutoIndent): Test it.
>> ---
> 
> ACK. Might be useful sometimes. I looked for something like this once.

Thanks; pushed.

-- 
Eric Blake   eblake@xxxxxxxxxx    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

--
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]