diff --git a/games/battlestar/externs.h b/games/battlestar/externs.h index f47ca9f615b..2d853521cfd 100644 --- a/games/battlestar/externs.h +++ b/games/battlestar/externs.h @@ -279,7 +279,7 @@ int wear[NUMOFWORDS]; char beenthere[NUMOFROOMS+1]; char injuries[NUMOFINJURIES]; -char uname[MAXLOGNAME+1]; +char uname[MAXLOGNAME]; struct wlist { char *string; diff --git a/usr.bin/at/at.c b/usr.bin/at/at.c index 84e7dbde28a..07bf7ffd1cc 100644 --- a/usr.bin/at/at.c +++ b/usr.bin/at/at.c @@ -53,10 +53,10 @@ #include #endif -#if MAXLOGNAME > UT_NAMESIZE +#if (MAXLOGNAME-1) > UT_NAMESIZE #define LOGNAMESIZE UT_NAMESIZE #else -#define LOGNAMESIZE MAXLOGNAME +#define LOGNAMESIZE (MAXLOGNAME-1) #endif /* Local headers */ diff --git a/usr.sbin/pw/pw_user.c b/usr.sbin/pw/pw_user.c index faebb3063ea..a5ea8017434 100644 --- a/usr.sbin/pw/pw_user.c +++ b/usr.sbin/pw/pw_user.c @@ -44,10 +44,10 @@ #include "bitmap.h" #include "pwupd.h" -#if MAXLOGNAME > UT_NAMESIZE +#if (MAXLOGNAME-1) > UT_NAMESIZE #define LOGNAMESIZE UT_NAMESIZE #else -#define LOGNAMESIZE MAXLOGNAME +#define LOGNAMESIZE (MAXLOGNAME-1) #endif static int print_user(struct passwd * pwd, int pretty);