Fixed segfault when removing first image from file list, fixes issue #112
This commit is contained in:
		
							parent
							
								
									091aacb462
								
							
						
					
					
						commit
						cc479ca5ac
					
				
							
								
								
									
										2
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								Makefile
									
									
									
									
									
								
							| @ -1,4 +1,4 @@ | ||||
| VERSION = git-20131114 | ||||
| VERSION = git-20131116 | ||||
| 
 | ||||
| PREFIX    = /usr/local | ||||
| MANPREFIX = $(PREFIX)/share/man | ||||
|  | ||||
							
								
								
									
										4
									
								
								main.c
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								main.c
									
									
									
									
									
								
							| @ -296,7 +296,7 @@ void load_image(int new) | ||||
| 		remove_file(new, false); | ||||
| 		if (new >= filecnt) | ||||
| 			new = filecnt - 1; | ||||
| 		else if (new < fileidx) | ||||
| 		else if (new > 0 && new < fileidx) | ||||
| 			new--; | ||||
| 	} | ||||
| 	files[new].loaded = true; | ||||
| @ -532,7 +532,7 @@ void run(void) | ||||
| 				tns.cnt++; | ||||
| 			} else { | ||||
| 				remove_file(tns.cnt, false); | ||||
| 				if (tns.sel >= tns.cnt) | ||||
| 				if (tns.sel > 0 && tns.sel >= tns.cnt) | ||||
| 					tns.sel--; | ||||
| 			} | ||||
| 			if (tns.cnt == filecnt) | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Bert Münnich
						Bert Münnich