Re: g_strchug/g_strchomp/g_strstrip crash



Joe Shaw <joe helixcode com> writes:
> If a string passed to the g_strchug/g_strchomp/g_strstrip functions
> consists of all spaces, it crashes. In these cases, I think it's probably
> appropriate to return a g_strdup(""), but I wanted to run by the list to
> see if everyone agrees as opposed to returning a NULL before I whip up a
> patch.
> 
> Opinions?
> 

Shouldn't they just stick a '\0' in the first byte of the passed-in
string? Why strdup() a new string?

Havoc




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]