GNOME Bugzilla – Bug 583036
g_strchomp and g_strchug are not declared const
Last modified: 2014-01-20 09:54:44 UTC
I suggest that those two named functions have parameters which are declared as const, since the documents seem to indicate that they are not actually changed - it looks like the copy of the pointer passed as arguments is simply shifted up by the amount of whitespace (in the case of strchug) and returned. If that is the case, then I'd like to see the parameters marked const. If the stuff is actually changed, though, then I'd like some change in the documentation to indicate that data you pass to those commands should be strdup'd before passing. Other information:
Created attachment 157629 [details] [review] Bug 583036 — g_strchomp and g_strchug are not declared const Clarify in the documentation for g_strchomp() and g_strchug() that they modify the strings they're passed, and shouldn't be used on statically allocated memory. Closes: bgo#583036
Fixed by commit 2efc2ef77526fb902f1d603875eaca833b47f0b5.