You've already forked pgbackrest
mirror of
https://github.com/pgbackrest/pgbackrest.git
synced 2025-07-15 01:04:37 +02:00
Various Buffer improvements.
Add bufDup() and bufNewUsedC(). Arrange bufNewC() params to match bufNewUsedC() since they have always seemed backward. Fix bufHex() to only render the used portion of the buffer and fix some places where used was not being set correctly. Use a union to make macro assignments for all legal values without casting. This is much more likely to catch bad assignments.
This commit is contained in:
@ -152,7 +152,7 @@ ioTestFilterMultiplyProcess(IoTestFilterMultiply *this, const Buffer *input, Buf
|
||||
else
|
||||
{
|
||||
char flushZ[] = {this->flushChar, 0};
|
||||
bufCat(output, bufNewC(1, flushZ));
|
||||
bufCat(output, bufNewC(flushZ, 1));
|
||||
this->flushTotal--;
|
||||
}
|
||||
}
|
||||
@ -280,7 +280,7 @@ testRun(void)
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
ioBufferSizeSet(2);
|
||||
buffer = bufNew(2);
|
||||
bufferOriginal = bufNewC(3, "123");
|
||||
bufferOriginal = bufNewC("123", 3);
|
||||
|
||||
MEM_CONTEXT_TEMP_BEGIN()
|
||||
{
|
||||
|
Reference in New Issue
Block a user