Fix gcc8 snprintf truncation warning.

This commit is contained in:
John Hood
2018-04-11 18:10:59 -04:00
parent 10dca75fb2
commit 2a5b5410b2
+2 -2
View File
@@ -810,8 +810,8 @@ static void serve( int host_fd, Terminal::Complete &terminal, ServerConnection &
#ifdef HAVE_UTEMPTER
utempter_remove_record( host_fd );
char tmp[ 64 ];
snprintf( tmp, 64, "%s via mosh [%d]", host, getpid() );
char tmp[ 64 + NI_MAXHOST ];
snprintf( tmp, 64 + NI_MAXHOST, "%s via mosh [%d]", host, getpid() );
utempter_add_record( host_fd, tmp );
connected_utmp = true;