mirror of
				https://git.proxmox.com/git/mirror_zfs.git
				synced 2025-10-26 18:05:04 +03:00 
			
		
		
		
	Fix -Wformat-truncation warning in upgrade_set_callback()
Extend the buffer slightly resolve the warning.
    cmd/zfs/zfs_main.c: In function ‘upgrade_set_callback’:
    cmd/zfs/zfs_main.c:2446:22: error: ‘%llu’ directive output
    may be truncated writing between 1 and 20 bytes into a
    region of size 16 [-Werror=format-truncation=]
    cmd/zfs/zfs_main.c:2445:24: note: ‘snprintf’ output between
    2 and 21 bytes into a destination of size 16
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #13528
Closes #13575
			
			
This commit is contained in:
		
							parent
							
								
									60f2cfd24f
								
							
						
					
					
						commit
						d483ef3744
					
				| @ -2480,7 +2480,7 @@ upgrade_set_callback(zfs_handle_t *zhp, void *data) | ||||
| 
 | ||||
| 	/* upgrade */ | ||||
| 	if (version < cb->cb_version) { | ||||
| 		char verstr[16]; | ||||
| 		char verstr[24]; | ||||
| 		(void) snprintf(verstr, sizeof (verstr), | ||||
| 		    "%llu", (u_longlong_t)cb->cb_version); | ||||
| 		if (cb->cb_lastfs[0] && !same_pool(zhp, cb->cb_lastfs)) { | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Brian Behlendorf
						Brian Behlendorf