mirror of
				https://github.com/swaywm/sway.git
				synced 2025-11-03 09:01:43 -05:00 
			
		
		
		
	Merge pull request #628 from 1ace/fix/ipc-path
Always terminate ipc path
This commit is contained in:
		
						commit
						0cefde87e4
					
				
					 1 changed files with 1 additions and 0 deletions
				
			
		| 
						 | 
					@ -66,6 +66,7 @@ void ipc_init(void) {
 | 
				
			||||||
	// We want to use socket name set by user, not existing socket from another sway instance.
 | 
						// We want to use socket name set by user, not existing socket from another sway instance.
 | 
				
			||||||
	if (getenv("SWAYSOCK") != NULL && access(getenv("SWAYSOCK"), F_OK) == -1) {
 | 
						if (getenv("SWAYSOCK") != NULL && access(getenv("SWAYSOCK"), F_OK) == -1) {
 | 
				
			||||||
		strncpy(ipc_sockaddr->sun_path, getenv("SWAYSOCK"), sizeof(ipc_sockaddr->sun_path));
 | 
							strncpy(ipc_sockaddr->sun_path, getenv("SWAYSOCK"), sizeof(ipc_sockaddr->sun_path));
 | 
				
			||||||
 | 
							ipc_sockaddr->sun_path[sizeof(ipc_sockaddr->sun_path) - 1] = 0;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	unlink(ipc_sockaddr->sun_path);
 | 
						unlink(ipc_sockaddr->sun_path);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue