mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	pw-top: Limit length of formatted shortname to resolve build error
Resolves: "error: ‘%s’ directive output may be truncated writing likely 33 or more bytes into a region of size 10 [-Werror=format-truncation=]""
This commit is contained in:
		
							parent
							
								
									89bf8b8566
								
							
						
					
					
						commit
						7eb1257a8f
					
				
					 1 changed files with 3 additions and 1 deletions
				
			
		| 
						 | 
					@ -253,7 +253,9 @@ static void node_param(void *data, int seq,
 | 
				
			||||||
			{
 | 
								{
 | 
				
			||||||
				struct spa_audio_info_iec958 info = { 0 };
 | 
									struct spa_audio_info_iec958 info = { 0 };
 | 
				
			||||||
				if (spa_format_audio_iec958_parse(param, &info) >= 0) {
 | 
									if (spa_format_audio_iec958_parse(param, &info) >= 0) {
 | 
				
			||||||
					snprintf(n->format, sizeof(n->format), "IEC958 %s %d",
 | 
										/* MAX_FORMAT is 16 bytes + \0: 8 bytes in this string, upto 6 bytes for the rate,
 | 
				
			||||||
 | 
										 * leaving us 2 for the format */
 | 
				
			||||||
 | 
										snprintf(n->format, sizeof(n->format), "IEC958 %2.2s %d",
 | 
				
			||||||
						spa_debug_type_find_short_name(
 | 
											spa_debug_type_find_short_name(
 | 
				
			||||||
							spa_type_audio_iec958_codec, info.codec),
 | 
												spa_type_audio_iec958_codec, info.codec),
 | 
				
			||||||
						info.rate);
 | 
											info.rate);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue