Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • G GLib
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 861
    • Issues 861
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 40
    • Merge requests 40
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GNOMEGNOME
  • GLib
  • Issues
  • #2323
Closed
Open
Issue created Feb 07, 2021 by Ghost User@ghost

[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).

Edited Feb 07, 2021 by Ghost User
Assignee
Assign to
Time tracking