* libmisc/utmp.c: Fix the check for empty host in prepare_utmp()

and prepare_utmpx().
This commit is contained in:
nekral-guest 2009-04-22 21:04:16 +00:00
parent 7fb1063ccd
commit e76a5df932
2 changed files with 10 additions and 4 deletions

View File

@ -1,7 +1,13 @@
2009-04-22 Nicolas François <nicolas.francois@centraliens.net>
* 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 <nicolas.francois@centraliens.net>
* 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 <nicolas.francois@centraliens.net>

View File

@ -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