mirror of
				https://github.com/libssh2/libssh2.git
				synced 2025-11-03 22:13:11 +03:00 
			
		
		
		
	libssh2_banner_set: avoid unnecessary increment and explain code
This commit is contained in:
		@@ -408,12 +408,14 @@ libssh2_banner_set(LIBSSH2_SESSION * session, const char *banner)
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    memcpy(session->local.banner, banner, banner_len);
 | 
			
		||||
 | 
			
		||||
    /* first zero terminate like this so that the debug output is nice */
 | 
			
		||||
    session->local.banner[banner_len] = '\0';
 | 
			
		||||
    _libssh2_debug(session, LIBSSH2_TRACE_TRANS, "Setting local Banner: %s",
 | 
			
		||||
                   session->local.banner);
 | 
			
		||||
    session->local.banner[banner_len++] = '\r';
 | 
			
		||||
    session->local.banner[banner_len++] = '\n';
 | 
			
		||||
    session->local.banner[banner_len++] = '\0';
 | 
			
		||||
    session->local.banner[banner_len] = '\0';
 | 
			
		||||
 | 
			
		||||
    return 0;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user