* libmisc/limits.c: Fix the format to match the unsigned long

variable in argument.
	* libmisc/utmp.c: Fix tests. tmptty is a variable stack. ut_host
	is an array of the ut structure. None of them can be NULL.
This commit is contained in:
nekral-guest
2009-09-07 19:50:00 +00:00
parent 2a58111fc1
commit 031279dfb2
3 changed files with 11 additions and 4 deletions

View File

@@ -71,7 +71,7 @@ static bool is_my_tty (const char *tty)
}
}
if (NULL == tmptty) {
if ('\0' == tmptty[0]) {
(void) puts (_("Unable to determine your tty name."));
exit (EXIT_FAILURE);
} else if (strncmp (tty, tmptty, sizeof (tmptty)) != 0) {
@@ -200,7 +200,6 @@ static void updwtmpx (const char *filename, const struct utmpx *utx)
strcpy (hostname, host);
#ifdef HAVE_STRUCT_UTMP_UT_HOST
} else if ( (NULL != ut)
&& (NULL != ut->ut_host)
&& ('\0' != ut->ut_host[0])) {
hostname = (char *) xmalloc (sizeof (ut->ut_host) + 1);
strncpy (hostname, ut->ut_host, sizeof (ut->ut_host));