Re: [PATCH v1 1/6] target_fileio_read_stralloc: add an optional length parameter

Thiago Jung Bauermann <[email protected]> Mon, 03 Aug 2026 04:49:35 +0000
Newsgroups gmane.comp.gdb.patches
Message-ID <[email protected]>
Matthieu Longo <[email protected]> writes:

> Extend target_fileio_read_stralloc with an optional output parameter
> that returns the number of bytes read, excluding the terminating NUL
> byte.
>
> Most callers only need the returned NUL-terminated buffer and can
> ignore the new parameter, but callers that need the number of bytes
> read can now obtain it without recomputing it.
>
> While updating the function, make a couple of minor cleanups by using
> '\0' instead of 0 for character literals and clarifying the function
> documentation.
> ---
>  gdb/target.c | 11 ++++++++---
>  gdb/target.h | 20 ++++++++++++--------
>  2 files changed, 20 insertions(+), 11 deletions(-)

Reviewed-by: Thiago Jung Bauermann <[email protected]>

-- 
Thiago
(he/him)