summaryrefslogtreecommitdiffstats
path: root/gtk-gui.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2012-12-14 07:24:08 -1000
committerGravatar Dirk Hohndel <dirk@hohndel.org>2012-12-14 07:34:14 -1000
commit371ace39b54266b9833d90d9d8e863b8bea3ac8f (patch)
treee2abdf8679f07b3b641ef51f7595fcaa233c8da2 /gtk-gui.c
parent713a4fcff6a580aab4a5036a5c3603ebce7ee830 (diff)
downloadsubsurface-371ace39b54266b9833d90d9d8e863b8bea3ac8f.tar.gz
Fix possible crash in nickname code
Silly typo, but this is the better solution, anyway. Reported-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>` Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'gtk-gui.c')
-rw-r--r--gtk-gui.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gtk-gui.c b/gtk-gui.c
index 18a022c9d..f3646b0ff 100644
--- a/gtk-gui.c
+++ b/gtk-gui.c
@@ -2091,7 +2091,7 @@ void set_dc_nickname(struct dive *dive)
entry = gtk_entry_new();
gtk_container_add(GTK_CONTAINER(frame), entry);
gtk_entry_set_max_length(GTK_ENTRY(entry), 68);
- snprintf(nickname, 69, "%s (%08x)", dive->dc.model, dive->dc.deviceid);
+ snprintf(nickname, sizeof(nickname), "%s (%08x)", dive->dc.model, dive->dc.deviceid);
gtk_entry_set_text(GTK_ENTRY(entry), nickname);
gtk_widget_show_all(dialog);
if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) {