From 982a078d512dd6b4b49cd669915d72a131412c56 Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Wed, 22 Nov 2000 15:50:10 +0000 Subject: check for return values 2000-11-22 Radek Doulik * camel-mime-utils.c (header_msgid_generate): check for return values svn path=/trunk/; revision=6651 --- camel/ChangeLog | 5 +++++ camel/camel-mime-utils.c | 8 +++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/camel/ChangeLog b/camel/ChangeLog index d5766dd0f2..e80ff42226 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,3 +1,8 @@ +2000-11-22 Radek Doulik + + * camel-mime-utils.c (header_msgid_generate): check for return + values + 2000-11-21 Dan Winship * camel-lock.c: diff --git a/camel/camel-mime-utils.c b/camel/camel-mime-utils.c index f57b876e67..4fa150ae2a 100644 --- a/camel/camel-mime-utils.c +++ b/camel/camel-mime-utils.c @@ -3104,10 +3104,12 @@ header_msgid_generate (void) { gchar host [256], domain [768]; static gint count = 0; + gint hrv, drv; - gethostname (host, sizeof (host)); - getdomainname (domain, sizeof (domain)); + hrv = gethostname (host, sizeof (host)); + drv = getdomainname (domain, sizeof (domain)); return g_strdup_printf ("%d.%d.%d.camel@%s.%s", (gint) time (NULL), getpid (), count++, - (host && *host) ? host : "unknown.host", (domain && *domain) ? domain : "unknown.domain"); + (hrv == 0 && host && *host) ? host : "unknown.host", + (drv && domain && *domain) ? domain : "unknown.domain"); } -- cgit v1.2.3