Audit and fix up format strings

This commit is contained in:
Benjamin Barenblat
2022-08-03 19:32:39 -04:00
committed by Benjamin Barenblat
parent 4cd2da5202
commit cd7050613c
3 changed files with 30 additions and 9 deletions
+2 -2
View File
@@ -807,7 +807,7 @@ static void serve( int host_fd, Terminal::Complete &terminal, ServerConnection &
#ifdef HAVE_UTEMPTER
utempter_remove_record( host_fd );
char tmp[ 64 + NI_MAXHOST ];
snprintf( tmp, 64 + NI_MAXHOST, "%s via mosh [%d]", host, getpid() );
snprintf( tmp, 64 + NI_MAXHOST, "%s via mosh [%ld]", host, static_cast<long int>( getpid() ) );
utempter_add_record( host_fd, tmp );
connected_utmp = true;
@@ -899,7 +899,7 @@ static void serve( int host_fd, Terminal::Complete &terminal, ServerConnection &
utempter_remove_record( host_fd );
char tmp[ 64 ];
snprintf( tmp, 64, "mosh [%d]", getpid() );
snprintf( tmp, 64, "mosh [%ld]", static_cast<long int>( getpid() ) );
utempter_add_record( host_fd, tmp );
connected_utmp = false;