summaryrefslogtreecommitdiffstats
path: root/qt-ui
diff options
context:
space:
mode:
authorGravatar Lubomir I. Ivanov <neolit123@gmail.com>2014-11-11 21:41:47 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-11-11 11:59:35 -0800
commit200699706ea0ae45b9036a3082bff83f98329f93 (patch)
treed8b9c910ef50e2eb7acf9c6b6355df31432b6e6a /qt-ui
parentd06cc2c68e10bb3674c8f13d0cc8abbe78b0a2c8 (diff)
downloadsubsurface-200699706ea0ae45b9036a3082bff83f98329f93.tar.gz
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>
Diffstat (limited to 'qt-ui')
-rw-r--r--qt-ui/maintab.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp
index 2962efc6f..c20eddbe1 100644
--- a/qt-ui/maintab.cpp
+++ b/qt-ui/maintab.cpp
@@ -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;