mirror of
				https://github.com/swaywm/sway.git
				synced 2025-11-03 09:01:43 -05:00 
			
		
		
		
	We don't need to implement strdup
After defining _GNU_SOURCE
This commit is contained in:
		
							parent
							
								
									11b1ba397f
								
							
						
					
					
						commit
						c43ef2aedd
					
				
					 3 changed files with 6 additions and 16 deletions
				
			
		| 
						 | 
				
			
			@ -33,5 +33,4 @@ char *cmdsep(char **stringp, const char *delim);
 | 
			
		|||
// Split string into 2 by delim, handle quotes
 | 
			
		||||
char *argsep(char **stringp, const char *delim);
 | 
			
		||||
 | 
			
		||||
char *strdup(const char *);
 | 
			
		||||
#endif
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -362,12 +362,3 @@ char *argsep(char **stringp, const char *delim) {
 | 
			
		|||
	found:
 | 
			
		||||
	return start;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
char *strdup(const char *str) {
 | 
			
		||||
	char *dup = malloc(strlen(str) + 1);
 | 
			
		||||
	if (dup) {
 | 
			
		||||
		strcpy(dup, str);
 | 
			
		||||
	}
 | 
			
		||||
	return dup;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue