mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 09:26:05 +00:00 
			
		
		
		
	Reserve space for \0 in cmd_print, from George Nachman.
This commit is contained in:
		
							
								
								
									
										4
									
								
								cmd.c
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								cmd.c
									
									
									
									
									
								
							@@ -295,8 +295,8 @@ cmd_print(struct cmd *cmd, char *buf, size_t len)
 | 
				
			|||||||
	size_t	off, used;
 | 
						size_t	off, used;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	off = xsnprintf(buf, len, "%s ", cmd->entry->name);
 | 
						off = xsnprintf(buf, len, "%s ", cmd->entry->name);
 | 
				
			||||||
	if (off < len) {
 | 
						if (off + 1 < len) {
 | 
				
			||||||
		used = args_print(cmd->args, buf + off, len - off);
 | 
							used = args_print(cmd->args, buf + off, len - off - 1);
 | 
				
			||||||
		if (used == 0)
 | 
							if (used == 0)
 | 
				
			||||||
			off--;
 | 
								off--;
 | 
				
			||||||
		else
 | 
							else
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user