mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Do something half-way sane (no SIGSEGV) when there are no dives
It just leaves ugly blank areas, but whatever. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
00d798854a
commit
968aa28155
2 changed files with 9 additions and 2 deletions
7
info.c
7
info.c
|
|
@ -12,6 +12,13 @@ void update_dive_info(struct dive *dive)
|
|||
struct tm *tm;
|
||||
char buffer[80];
|
||||
|
||||
if (!dive) {
|
||||
gtk_entry_set_text(GTK_ENTRY(datetime), "no dive");
|
||||
gtk_entry_set_text(GTK_ENTRY(depth), "");
|
||||
gtk_entry_set_text(GTK_ENTRY(duration), "");
|
||||
return;
|
||||
}
|
||||
|
||||
tm = gmtime(&dive->when);
|
||||
snprintf(buffer, sizeof(buffer),
|
||||
"%04d-%02d-%02d "
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue