[9061] in The GTK GIMP ToolKit mailing list archive

home help back first fref pref prev next nref lref last post

[gtk-list] another GDK segfault...

daemon@ATHENA.MIT.EDU (Luyseyal)
Mon Oct 5 17:07:45 1998

Date: Mon, 05 Oct 1998 16:04:49 -0500
From: Luyseyal <luyseyal@austin.cc.tx.us>
To: gtk-list@redhat.com
Resent-From: gtk-list@redhat.com
Reply-To: gtk-list@redhat.com

working on a RH5.1 box w/ all updates:
glibc 2.0.7
glib 1.1.3
glib 1.0.5
glib10 1.0.6
gtk+ 1.1.2
gtk+ 1.0.5
glib10 1.0.6

(the g*10's are for gnome).

i've got a little snippet of code that segfaults everytime i call it.
if this is a stupid error, i'm sorry, i'm still learning C.

<snip-snip>

#define _GNU_SOURCE
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <gtk/gtk.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>


gchar
*thishostname()
{
	struct hostent *thishost;
	sethostent(0);
	thishost = gethostent() ;
	endhostent();
	return thishost->h_name;
	
}

void
main
{
	g_print("hostname: %s \n", thishostname());
}


<snip-snip>


it bombs every time w/o fail. what is it that i'm missing?

thanks,

-l

-- 
To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null


home help back first fref pref prev next nref lref last post