This is the mail archive of the
mailing list for the Archer project.
Re: [python][patch] Add options length parameter to value.string(...)
Phil Muldoon wrote:
Tom Tromey wrote:
"Phil" == Phil Muldoon <firstname.lastname@example.org> writes:
Phil> + buffer in BUFFER, which should be freed by the caller. If length
Phil> + is specified at -1, the string is read until a null character is
Phil> + found, otherwise the string is read to the length specified.
This should mention that length is in units of characters.
And, it seems weird that on input length is characters and on output
it is bytes. Please change this to be characters uniformly.
Yeah I was naively replicating the behavior from read_string which
expects a character length and returns bytes read; but you are right
it is totally the wrong semantics to use in this case. Thanks for
spotting this. In this case is multiplying the number of bytes read as
returned by read_string, and multiplying it by the width the right
thing to return here?