summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlbrecht Schlosser <albrechts.fltk@online.de>2024-01-19 19:38:11 +0100
committerAlbrecht Schlosser <albrechts.fltk@online.de>2024-01-19 19:38:11 +0100
commitb5b839e4f00f5cb0dde2de165ebb7c4bcbf65c3c (patch)
tree086b098ec29845c5b311f9ae81eccfb464af32e9 /src
parented757454ebc63ad112d29a3b432f8dda4b67dfdd (diff)
Fix compiler warning [-Wmaybe-uninitialized]
'buf' could indeed be used uninitialized if the switch statement below was executed with an unknown style (no default case).
Diffstat (limited to 'src')
-rw-r--r--src/drivers/Xlib/Fl_Xlib_Graphics_Driver_line_style.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_line_style.cxx b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_line_style.cxx
index 36fa8edb8..07c05eb54 100644
--- a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_line_style.cxx
+++ b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_line_style.cxx
@@ -1,7 +1,7 @@
//
// Line style code for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2021 by Bill Spitzak and others.
+// Copyright 1998-2024 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -30,7 +30,7 @@ void Fl_Xlib_Graphics_Driver::line_style_unscaled(int style, int width, char* da
int ndashes = dashes ? strlen(dashes) : 0;
// emulate the Windows dash patterns on X
- char buf[7];
+ char buf[7] = {0};
if (!ndashes && (style&0xff)) {
int w = width ? width : 1;
char dash, dot, gap;