When arguments are passed through ..., the C standard mandates that char
is promoted to int (other types are promoted as well, but that's outside
the scope of this commit). This happens with any argument passed through
va_start as well. Therefore, the last argument before variable arguments
in C must be a promoted type. Otherwise, the behaviour is undefined
(probably fine on most ABIs, but stricter ABIs might break).
Signed-off-by: Elizabeth Kiara Regina Ashford <elizabeth.jennifer.myers@gmail.com>
This allows for pkgconf_buffer_finalize() to reset a buffer, not simply free the
underlying resources.
Signed-off-by: Ariadne Conill <ariadne@ariadne.space>
Previously, pkgconf_buffer_append would append a nul byte to the buffer
because buffer->end was set to include the nul byte added by pkgconf_strlcpy.
(Buffers internally are a multiple of PAGE_SIZE, so this was not a security problem.)
Signed-off-by: Ariadne Conill <ariadne@ariadne.space>