Re: [PATCH] virBufferAdd: Ensure that the buffer is initialized also when len == 0

2021-03-04 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: There's an optimization in virBufferAdd which returns early when the length of the added string is 0 (given that auto-indent is disabled). The optimization causes inconsistent behaviour between these two cases: virBufferAdd(buf, "", 0); // this

[PATCH] virBufferAdd: Ensure that the buffer is initialized also when len == 0

2021-03-04 Thread Peter Krempa
There's an optimization in virBufferAdd which returns early when the length of the added string is 0 (given that auto-indent is disabled). The optimization causes inconsistent behaviour between these two cases: virBufferAdd(buf, "", 0); // this doesn't initialize the buffer and