]> granicus.if.org Git - shadow/commitdiff
* libmisc/utmp.c: Fix the check for empty host in prepare_utmp()
authornekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Wed, 22 Apr 2009 21:04:16 +0000 (21:04 +0000)
committernekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Wed, 22 Apr 2009 21:04:16 +0000 (21:04 +0000)
and prepare_utmpx().

ChangeLog
libmisc/utmp.c

index dd081c35777750e8a943522fa3a48be12eece192..f37e2a87db5ef9027cd02615017e004b19a20d7b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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>
 
index fba1b72d7571c8cfec26440b8e7794a740e51175..8030908aba932921fbb7dcb351592df9b56c8999 100644 (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