mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +00:00 
			
		
		
		
	maintab.cpp: use copy_string() instead of strdup()
The .location and .notes fields can end up being NULL, in which case copy_string() is safer. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
		
							parent
							
								
									d06cc2c68e
								
							
						
					
					
						commit
						200699706e
					
				
					 1 changed files with 2 additions and 2 deletions
				
			
		|  | @ -691,11 +691,11 @@ void MainTab::acceptChanges() | |||
| 	} else if (MainWindow::instance() && MainWindow::instance()->dive_list()->selectedTrips().count() == 1) { | ||||
| 		/* now figure out if things have changed */ | ||||
| 		if (!same_string(displayedTrip.notes, currentTrip->notes)) { | ||||
| 			currentTrip->notes = strdup(displayedTrip.notes); | ||||
| 			currentTrip->notes = copy_string(displayedTrip.notes); | ||||
| 			mark_divelist_changed(true); | ||||
| 		} | ||||
| 		if (!same_string(displayedTrip.location, currentTrip->location)) { | ||||
| 			currentTrip->location = strdup(displayedTrip.location); | ||||
| 			currentTrip->location = copy_string(displayedTrip.location); | ||||
| 			mark_divelist_changed(true); | ||||
| 		} | ||||
| 		currentTrip = NULL; | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue