* lib/defines.h: Include <utmpx.h> and <utmp.h> to define

USER_NAME_MAX_LENGTH.
This commit is contained in:
nekral-guest 2009-04-28 21:01:20 +00:00
parent 1e75786616
commit 72fa8afa07
2 changed files with 7 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2009-04-28 Nicolas François <nicolas.francois@centraliens.net>
* lib/defines.h: Include <utmpx.h> and <utmp.h> to define
USER_NAME_MAX_LENGTH.
2009-04-28 Nicolas François <nicolas.francois@centraliens.net> 2009-04-28 Nicolas François <nicolas.francois@centraliens.net>
* src/login.c: Change a snprintf() to strncpy(). There are no * src/login.c: Change a snprintf() to strncpy(). There are no

View File

@ -367,8 +367,10 @@ extern char *strerror ();
/* Maximum length of usernames */ /* Maximum length of usernames */
#ifdef HAVE_UTMPX_H #ifdef HAVE_UTMPX_H
# include <utmpx.h>
# define USER_NAME_MAX_LENGTH (sizeof (((struct utmpx *)NULL)->ut_user)) # define USER_NAME_MAX_LENGTH (sizeof (((struct utmpx *)NULL)->ut_user))
#else #else
# include <utmp.h>
# ifdef HAVE_STRUCT_UTMP_UT_USER # ifdef HAVE_STRUCT_UTMP_UT_USER
# define USER_NAME_MAX_LENGTH (sizeof (((struct utmp *)NULL)->ut_user)) # define USER_NAME_MAX_LENGTH (sizeof (((struct utmp *)NULL)->ut_user))
# else # else