X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=info.c;h=b65a82081cc51a061326a964a0f3b551368ad43e;hb=27ed16072f3b49b07e0af495fed10f883de90c82;hp=9cb048b808fbba20b8ed5b1daa0bfc4a700abaa8;hpb=067506038a5fea72e60680513d768f89722671fd;p=ext%2Fsubsurface.git diff --git a/info.c b/info.c index 9cb048b..b65a820 100644 --- a/info.c +++ b/info.c @@ -51,6 +51,7 @@ void show_dive_info(struct dive *dive) struct tm *tm; char buffer[80]; char *text; + int len; if (!dive) { gtk_label_set_text(GTK_LABEL(divedate), "no dive"); @@ -115,7 +116,12 @@ void show_dive_info(struct dive *dive) text = dive->location ? : ""; gtk_entry_set_text(location, text); - gtk_label_set_text(GTK_LABEL(locationnote), text); + + len = 0; + if (dive->number) + len = snprintf(buffer, sizeof(buffer), "%d. ", dive->number); + snprintf(buffer+len, sizeof(buffer)-len, "%s", text); + gtk_label_set_text(GTK_LABEL(locationnote), buffer); text = dive->notes ? : ""; gtk_text_buffer_set_text(notes, text, -1);