diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2012-09-15 20:51:06 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2012-09-17 21:03:30 -0400 |
commit | 7148dea82795b81311c46dfb11d09c8fa2b13452 (patch) | |
tree | 5635ac7d83b99b8c774af655c5fdfa2a443ef900 /dive.h | |
parent | fa2f1b6eb06e65e6426cc3a488c6cb5c960e7d49 (diff) | |
download | subsurface-7148dea82795b81311c46dfb11d09c8fa2b13452.tar.gz |
Once again improve existing filename handling
Several potential problems.
- we could end up dereferencing exiting_filename when it was NULL
- we could free the default_filename by mistake -
subsurface_default_filename always needs to return a copy of it
- closing the existing file before opening a new one repopulated the
existing_filename with the default filename - preventing the opened
file to become the new existing filename
Also, make existing filename a const char * and make file_open have the
same sensible default folder behavior as the other file related functions.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'dive.h')
-rw-r--r-- | dive.h | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -463,7 +463,7 @@ const char *monthname(int mon); extern const char *star_strings[]; extern const char *default_filename; -extern char *existing_filename; +extern const char *existing_filename; extern const char *subsurface_default_filename(void); #define AIR_PERMILLE 209 |