This is the mail archive of the archer@sourceware.org mailing list for the Archer project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [python][patch] Add options length parameter to value.string(...)


Tom Tromey wrote:
"Phil" == Phil Muldoon <pmuldoon@redhat.com> 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?



Regards


Phil


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]