On Thu, Oct 13, 2016 at 5:23 PM, Martin Liška <mli...@suse.cz> wrote:
> After receiving feedback from Richi and Wilco Dijkstra, I decided to fully not
> support not null-terminated strings. It brings more complications and the
> code has started
> to be overengineered. Thus c_getstr accepts only such strings and as a bonus
> it returns
> length of a string.
> Patch can bootstrap on ppc64le-redhat-linux and survives regression tests.
> Ready to be installed?
+ /* Support only properly null-terminated strings. */
+ if (string_length == 0
+ || string[string_length - 1] != '\0'
+ || offset > string_length)
shouldn't this be offset >= string_length?
Ok with that change.