Silences gcc 8.1.1's warning that strncpy(3)'s length is the sizeof of
the source, not the destination, by removing the strncpy and passing the
source to alert() where it's only read, not written.
main (int argc, char **argv)
{
int md, vecp = 0;
main (int argc, char **argv)
{
int md, vecp = 0;
- char *cp, *user, buf[BUFSIZ], tty[BUFSIZ];
+ char *cp, *user, buf[BUFSIZ];
char **argp, **arguments, *vec[MAXARGS];
struct utmpx *utp;
char **argp, **arguments, *vec[MAXARGS];
struct utmpx *utp;
if (utp->ut_type == USER_PROCESS && utp->ut_user[0] != 0
&& utp->ut_line[0] != 0
&& strncmp (user, utp->ut_user, sizeof(utp->ut_user)) == 0) {
if (utp->ut_type == USER_PROCESS && utp->ut_user[0] != 0
&& utp->ut_line[0] != 0
&& strncmp (user, utp->ut_user, sizeof(utp->ut_user)) == 0) {
- strncpy (tty, utp->ut_line, sizeof(utp->ut_line));
- alert (tty, md);
+ alert(utp->ut_line, md);
NMH_UNUSED (utp);
#endif /* HAVE_GETUTXENT */
NMH_UNUSED (utp);
#endif /* HAVE_GETUTXENT */