- strncpy(utmpx.ut_user, name, sizeof(utmpx.ut_user));
- strncpy(utmpx.ut_id, ifname, sizeof(utmpx.ut_id));
- strncpy(utmpx.ut_line, line, sizeof(utmpx.ut_line));
+ strlcpy(utmpx.ut_user, sizeof(utmpx.ut_user), name);
+ strlcpy(utmpx.ut_id, sizeof(utmpx.ut_id), ifname);
+ strlcpy(utmpx.ut_line, sizeof(utmpx.ut_line), line);