[GLIB 2.66.6] g_io_channel_set_line_term() stopped working with null terminated strings and length -1
Hello!
I think the commit ecdf9140 contains an error. I noticed that Geeqie is broken with GLIB "2.66.6". Geeqie uses g_io_channel_set_line_term(channel, "<gq_end_of_command>", -1)
which is valid according to the API. Therefore we should land in the else branch:
gsize length_size = strlen (line_term);
g_return_if_fail (length_size > G_MAXUINT);
I think the author wants to use the less-than operator <
or even the less-than-or-equal operator <=
. I'm not familiar with the API and therefore cannot say if more changes are required.
Thank you
PS:
Personally I'm not happy with data type hiding or layering. I would prefer storing the result of strlen() in a size_t
which it returns. And gsize could be either 32 bit wide on Windows (LLP64) or 64 bit wide on Unix/Linux (LP64).