aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2017-11-23 16:43:24 +0100
committerThomas White <taw@physics.org>2017-11-23 16:44:36 +0100
commit5f2dd7f6d79f7e0d11012d2f85b68c774c6e95ee (patch)
tree33fe87e6648f50f89623fbbae84c8d8f7acec75b /src
parent4e8858bcb532a3c90844c48194792237f611d524 (diff)
Avoid truncation with snprintf
Just something that came from new compiler warnings after upgrading my system.
Diffstat (limited to 'src')
-rw-r--r--src/dw-hdfsee.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/dw-hdfsee.c b/src/dw-hdfsee.c
index c943cfdf..c1bb39cc 100644
--- a/src/dw-hdfsee.c
+++ b/src/dw-hdfsee.c
@@ -2626,9 +2626,12 @@ static void calibmode_press(DisplayWindow *dw, GdkEventButton *event)
if ( revmap_return_value == 0 ) {
fs = dfs;
ss = dss;
- snprintf(statusbar_string, 80,
- "Last clicked position: x: %i, y: %i, fs: %u, ss: %u,"
- " (panel %s)", x, y, fs, ss, p->name);
+ if ( snprintf(statusbar_string, 80,
+ "Last clicked position: x: %i, y: %i, fs: %u, ss: %u,"
+ " (panel %s)", x, y, fs, ss, p->name) != 0 )
+ {
+ ERROR("Panel name is too long for status bar.\n");
+ }
}
gtk_statusbar_push(GTK_STATUSBAR(dw->statusbar), cc, statusbar_string);
}