You've already forked FFmpeg
							
							
				mirror of
				https://github.com/FFmpeg/FFmpeg.git
				synced 2025-10-30 23:18:11 +02:00 
			
		
		
		
	cmdutils: replace strncpy() with direct assignment
Only one character is actually rewritten. Fixes truncation warnings, such as warning: ‘strncpy’ output truncated before terminating nul copying 3 bytes from a string of the same length [-Wstringop-truncation] in gcc 10.2.0
This commit is contained in:
		| @@ -1163,13 +1163,13 @@ static void print_buildconf(int flags, int level) | ||||
|     // Change all the ' --' strings to '~--' so that | ||||
|     // they can be identified as tokens. | ||||
|     while ((conflist = strstr(str, " --")) != NULL) { | ||||
|         strncpy(conflist, "~--", 3); | ||||
|         conflist[0] = '~'; | ||||
|     } | ||||
|  | ||||
|     // Compensate for the weirdness this would cause | ||||
|     // when passing 'pkg-config --static'. | ||||
|     while ((remove_tilde = strstr(str, "pkg-config~")) != NULL) { | ||||
|         strncpy(remove_tilde, "pkg-config ", 11); | ||||
|         remove_tilde[sizeof("pkg-config~") - 2] = ' '; | ||||
|     } | ||||
|  | ||||
|     splitconf = strtok(str, "~"); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user