Recent versions of gcc produce warnings on code where strncpy will
produce a result that is not NULL terminated. This changes the
code to eliminate these warnings. In two cases this is done by
changing strncpy to strlcpy, which could in principle cause a loss
of the information in the last byte. This is not a concern in
these cases because:
- In sys-linux.c, the interface names in struct ifreq were possibly
not NULL terminated. The Linux kernel clears the last byte to make
them NULL terminated anyway, so there is no loss of information.
- In session.c, the lastlog ll_line and ll_host fields were possibly
not NULL terminated. These fields are quite long and it is unlikely
that the last byte is needed.
In the other cases strlcpy and strlcat are used to give the same
effect as the old code but without warnings.
This also changes %ld to %d in one place to eliminate a format warning.