gui: Make lex_gtk_text_buffer_read() count bytes, not characters. 20120507030502/pspp 20120508030509/pspp 20120509030502/pspp
authorBen Pfaff <blp@cs.stanford.edu>
Sun, 6 May 2012 15:06:57 +0000 (08:06 -0700)
committerBen Pfaff <blp@cs.stanford.edu>
Sun, 6 May 2012 15:07:10 +0000 (08:07 -0700)
commit5841c349770a82f091e77dfe90fd68eee6032f66
tree86232abc614951586eb01c47ffca84bf7058947f
parent0838c7ce8528a241fd6bb422767e187af4b5d9a7
gui: Make lex_gtk_text_buffer_read() count bytes, not characters.

The N parameter to lex_gtk_text_buffer_read() is a count of bytes,
but the implementation treated it as characters.

Also fixes a memory leak, since gtk_text_iter_get_text()'s caller
is responsible for freeing the memory that it returns.

Reported by Alle <ajk-eis@rvhome.de>.
First investigated by John Darrington <john@darrington.wattle.id.au>.
Reviewed by John Darrington <john@darrington.wattle.id.au>.
src/ui/gui/psppire-lex-reader.c