Daniel,

On Sat, May 8, 2010 at 7:18 PM, Daniel Leidert
<daniel.leidert.s...@gmx.net> wrote:
> Is it the desired behavior, that
>
> g_strstrip(" ")
>
> leads to a segmentation fault? I would expect, that an empty string ("")
> or NULL is returned.

The literal " " is a constant -- the operating system might allocate
that to a read-only region. Since g_strstrip() modifies the string
in-place, it isn't surprising that the program segfaults. If the
string you'd like to work with g_strstrip() is a constant, you might
consider using g_strdup() (and g_free() when you're done with it).

Cheers,
    Leandro
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Reply via email to