Re: g_strchug/g_strchomp/g_strstrip crash
- From: Havoc Pennington <hp redhat com>
- To: Joe Shaw <joe helixcode com>
- Cc: gtk-devel-list gnome org
- Subject: Re: g_strchug/g_strchomp/g_strstrip crash
- Date: 08 Sep 2000 18:35:56 -0400
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]