wmitime: Allow -display option with no argument
Previously, if a user ran wmitime with the -display option and no argument, a segmentation fault would occur. Print a warning instead. Patch from Debian [1] to fix bug #716466 [2]. [1] http://sources.debian.net/src/wmitime/0.3%2B20120605-1/debian/patches/allow_display_with_no_args.patch/ [2] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=716466
This commit is contained in:
		
							parent
							
								
									cd2840a93c
								
							
						
					
					
						commit
						7bc4cffcc7
					
				
					 1 changed files with 5 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -385,7 +385,11 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit
 | 
			
		|||
	for (i=1; argv[i]; i++) {
 | 
			
		||||
		if (!strcmp(argv[i], "-display")) {
 | 
			
		||||
			display_name = argv[i+1];
 | 
			
		||||
			i++;
 | 
			
		||||
			if (!display_name)
 | 
			
		||||
				printf("Please provide an argument for "
 | 
			
		||||
				       "-display.\n");
 | 
			
		||||
			else
 | 
			
		||||
				i++;
 | 
			
		||||
		}
 | 
			
		||||
		if (!strcmp(argv[i], "-geometry")) {
 | 
			
		||||
			geometry = argv[i+1];
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue