From e76a5df9326d406472106477df159bd923df3010 Mon Sep 17 00:00:00 2001 From: nekral-guest Date: Wed, 22 Apr 2009 21:04:16 +0000 Subject: [PATCH] * libmisc/utmp.c: Fix the check for empty host in prepare_utmp() and prepare_utmpx(). --- ChangeLog | 10 ++++++++-- libmisc/utmp.c | 4 ++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index dd081c35..f37e2a87 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,13 @@ 2009-04-22 Nicolas François - * libmisc/utmp.c: The ut argument of prepare_utmp() might be NULL. - ut_id needs to be forged in that case. + * libmisc/utmp.c: Fix the check for empty host in prepare_utmp() + and prepare_utmpx(). + +2009-04-22 Nicolas François + + * libmisc/utmp.c: The ut argument of prepare_utmp() and + prepare_utmpx () might be NULL. ut_id needs to be forged in that + case. 2009-04-22 Nicolas François diff --git a/libmisc/utmp.c b/libmisc/utmp.c index fba1b72d..8030908a 100644 --- a/libmisc/utmp.c +++ b/libmisc/utmp.c @@ -198,7 +198,7 @@ struct utmp *prepare_utmp (const char *name, if ( (NULL != host) - && ('\0' != host)) { + && ('\0' != host[0])) { hostname = (char *) xmalloc (strlen (host) + 1); strcpy (hostname, host); #ifdef HAVE_STRUCT_UTMP_UT_HOST @@ -340,7 +340,7 @@ struct utmpx *prepare_utmpx (const char *name, if ( (NULL != host) - && ('\0' != host)) { + && ('\0' != host[0])) { hostname = (char *) xmalloc (strlen (host) + 1); strcpy (hostname, host); #ifdef HAVE_STRUCT_UTMP_UT_HOST