Re: gtk_text_insert causes segfault



David,

I think you'll find it is the strlen(foobar) causing the seg fault and
not the
gtk_text_insert();

Aaron

David Allen wrote:

> It seems that gtk_text_insert consistently causes a segfault when you
give
> it a null string - of course it was easy enough to build in not to
call that
> if the string I wanted to print happened to be null, but is that the
kind of
> thing that GTK would want to watch for itself, or something that the
> programmer should watch out for himself?
>
> char *foobar = NULL;
> gtk_text_insert(GTK_TEXT(some_text_widget), NULL, NULL, NULL,
>                 foobar, strlen(foobar));

--
...Unix, MS-DOS, and Windows NT (also known as the Good, the Bad, and the Ugly).

                               ----==-- _                     / /  \
                               ---==---(_)__  __ ____  __    / / /\ \
                               --==---/ / _ \/ // /\ \/ /   / /_/\ \ \
                               -=====/_/_//_/\_,_/ /_/\_\  /______\ \ \
                               A proud member of TeamLinux \_________\/




David,

I think you'll find it is the strlen(foobar) causing the seg fault and not the
gtk_text_insert();

Aaron

David Allen wrote:

> It seems that gtk_text_insert consistently causes a segfault when you give
> it a null string - of course it was easy enough to build in not to call that
> if the string I wanted to print happened to be null, but is that the kind of
> thing that GTK would want to watch for itself, or something that the
> programmer should watch out for himself?
>
> char *foobar = NULL;
> gtk_text_insert(GTK_TEXT(some_text_widget), NULL, NULL, NULL,
>                 foobar, strlen(foobar));

--
...Unix, MS-DOS, and Windows NT (also known as the Good, the Bad, and the Ugly).

                               ----==-- _                     / /  \
                               ---==---(_)__  __ ____  __    / / /\ \
                               --==---/ / _ \/ // /\ \/ /   / /_/\ \ \
                               -=====/_/_//_/\_,_/ /_/\_\  /______\ \ \
                               A proud member of TeamLinux \_________\/







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