Off by 1 adjustment.

This commit is contained in:
Philippe Charnier 1997-06-02 06:27:00 +00:00
parent 73087c02bb
commit 4600c7fb36

View File

@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: netdate.c,v 1.6 1997/02/22 14:02:35 peter Exp $
* $Id: netdate.c,v 1.7 1997/03/10 19:49:03 guido Exp $
*/
#ifndef lint
@ -116,7 +116,7 @@ netsettime(tval)
warn("gethostname");
goto bad;
}
(void)strncpy(msg.tsp_name, hostname, sizeof(msg.tsp_name));
(void)strncpy(msg.tsp_name, hostname, sizeof(msg.tsp_name) - 1);
msg.tsp_name[sizeof(msg.tsp_name) - 1] = '\0';
msg.tsp_seq = htons((u_short)0);
msg.tsp_time.tv_sec = htonl((u_long)tval);