mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	pulse-server: use sizeof() instead of hard-coding
				
					
				
			Use `sizeof("/pid")` instead of hard-coding 5
in the condition.
			
			
This commit is contained in:
		
							parent
							
								
									627ef37a77
								
							
						
					
					
						commit
						b6405b761f
					
				
					 1 changed files with 1 additions and 1 deletions
				
			
		| 
						 | 
					@ -193,7 +193,7 @@ int create_pid_file(void) {
 | 
				
			||||||
	if ((res = get_runtime_dir(pid_file, sizeof(pid_file), "pulse")) < 0)
 | 
						if ((res = get_runtime_dir(pid_file, sizeof(pid_file), "pulse")) < 0)
 | 
				
			||||||
		return res;
 | 
							return res;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (strlen(pid_file) > PATH_MAX - 5) {
 | 
						if (strlen(pid_file) > PATH_MAX - sizeof("/pid")) {
 | 
				
			||||||
		pw_log_error(NAME": path too long: %s/pid", pid_file);
 | 
							pw_log_error(NAME": path too long: %s/pid", pid_file);
 | 
				
			||||||
		return -ENAMETOOLONG;
 | 
							return -ENAMETOOLONG;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue