Re: read() and label funkiness
- From: Havoc Pennington <hp redhat com>
- To: "Ben K" <kynneb hotmail com>
- Cc: gtk-list redhat com
- Subject: Re: read() and label funkiness
- Date: 09 Jun 2000 14:24:24 -0400
"Ben K" <kynneb@hotmail.com> writes:
> pppd_fd = open ("/etc/ppp/pppd.status", O_RDONLY); //get the fd
> read(pppd_fd, label_text_ptr, 25);//read 25 bytes
> gtk_label_set_text(GTK_LABEL( (GtkWidget*)data ), label_text_ptr);
read() isn't going to nul-terminate your string. Use calloc() or
g_malloc0() instead of malloc(). (Remember to use g_free() if you use
g_malloc0()).
Havoc
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]