aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/calobj.c
diff options
context:
space:
mode:
Diffstat (limited to 'calendar/calobj.c')
-rw-r--r--calendar/calobj.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/calendar/calobj.c b/calendar/calobj.c
index f1bec05c2b..7e1a3635db 100644
--- a/calendar/calobj.c
+++ b/calendar/calobj.c
@@ -25,9 +25,9 @@ ical_gen_uid (void)
if (!hostname){
char buffer [128];
- gethostname (buffer, sizeof (buffer)-1);
- if (hostname)
- hostname = g_strdup (hostname);
+ if ((gethostname (buffer, sizeof (buffer)-1) == 0) &&
+ (buffer [0] != 0))
+ hostname = g_strdup (buffer);
else
hostname = g_strdup ("localhost");
}