diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2012-12-10 11:02:33 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2012-12-10 11:02:33 -0800 |
commit | 0ae16899defc383eaedacf20f5ba03719d1e9322 (patch) | |
tree | 8dbac988f51d2842d71c8d66adfbcb5fde140624 /profile.c | |
parent | 7cf1960336011b8ef702c3bc2458b27db0fc1a4e (diff) | |
download | subsurface-0ae16899defc383eaedacf20f5ba03719d1e9322.tar.gz |
Don't draw tooltips if no profile is displayed
This fixes ticket 33
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'profile.c')
-rw-r--r-- | profile.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -2120,7 +2120,7 @@ void get_plot_details(struct graphics_context *gc, int time, char *buf, size_t b { struct plot_info *pi = &gc->pi; int pressure = 0, temp = 0; - struct plot_data *entry; + struct plot_data *entry = NULL; int i; for (i = 0; i < pi->nr; i++) { @@ -2132,5 +2132,6 @@ void get_plot_details(struct graphics_context *gc, int time, char *buf, size_t b if (entry->sec >= time) break; } - plot_string(entry, buf, bufsize, entry->depth, pressure, temp, pi->has_ndl); + if (entry) + plot_string(entry, buf, bufsize, entry->depth, pressure, temp, pi->has_ndl); } |