Don't call strdup on NULL by mistake

Hunting down a different issue I managed to cause a crash here when trying
to copy a string that ended up being NULL.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2014-11-01 22:36:42 -07:00
parent 6cf3787a0e
commit 6ce0afb99c

View file

@ -651,7 +651,7 @@ void MainTab::reload()
#define EDIT_TEXT(what) \
if (same_string(mydive->what, cd->what)) { \
free(mydive->what); \
mydive->what = strdup(displayed_dive.what); \
mydive->what = copy_string(displayed_dive.what); \
}
#define EDIT_VALUE(what) \