mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 00:56:10 +00:00 
			
		
		
		
	Sync OpenBSD patchset 1013:
Terminate strftime buffer properly even if a really long format string is given, from Tiago Cunha.
This commit is contained in:
		
							
								
								
									
										5
									
								
								status.c
									
									
									
									
									
								
							
							
						
						
									
										5
									
								
								status.c
									
									
									
									
									
								
							@@ -491,9 +491,10 @@ status_replace(struct client *c, struct session *s, struct winlink *wl,
 | 
			
		||||
{
 | 
			
		||||
	static char	out[BUFSIZ];
 | 
			
		||||
	char		in[BUFSIZ], ch, *iptr, *optr;
 | 
			
		||||
	size_t		len;
 | 
			
		||||
 | 
			
		||||
	strftime(in, sizeof in, fmt, localtime(&t));
 | 
			
		||||
	in[(sizeof in) - 1] = '\0';
 | 
			
		||||
	len = strftime(in, sizeof in, fmt, localtime(&t));
 | 
			
		||||
	in[len] = '\0';
 | 
			
		||||
 | 
			
		||||
	iptr = in;
 | 
			
		||||
	optr = out;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user