summaryrefslogtreecommitdiff
path: root/src/drivers/Cairo/Fl_Cairo_Graphics_Driver.cxx
diff options
context:
space:
mode:
authorMatthias Melcher <github@matthiasm.com>2023-01-26 15:23:43 +0100
committerGitHub <noreply@github.com>2023-01-26 15:23:43 +0100
commit179771acd25ee5ff8e36a5fd192682d4d55c52af (patch)
treef7d32685bccef27e64a6f706e7c0e0c9d099c372 /src/drivers/Cairo/Fl_Cairo_Graphics_Driver.cxx
parentf314ca75feab8c472a9b136fd25636d2d2da68a7 (diff)
Fixing FLUID file corruption from issue #653 (#662)
Removing all globals in file writer (#653 ) Fix some static analyser complaints Valgrind: handle width==0 in GfxDrivers on Wayland and X11 Don't use `Fl_Input_::static_value`, it accesses previous buffer that may be deleted Project file write encapsulated, removing globals Encapsulating project file reader, removing states in glbals Project i/o increased source code readability
Diffstat (limited to 'src/drivers/Cairo/Fl_Cairo_Graphics_Driver.cxx')
-rw-r--r--src/drivers/Cairo/Fl_Cairo_Graphics_Driver.cxx1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/drivers/Cairo/Fl_Cairo_Graphics_Driver.cxx b/src/drivers/Cairo/Fl_Cairo_Graphics_Driver.cxx
index 6433cf5c1..e0cbf26ce 100644
--- a/src/drivers/Cairo/Fl_Cairo_Graphics_Driver.cxx
+++ b/src/drivers/Cairo/Fl_Cairo_Graphics_Driver.cxx
@@ -1271,6 +1271,7 @@ double Fl_Cairo_Graphics_Driver::width(unsigned int utf32) {
double Fl_Cairo_Graphics_Driver::width(const char* str, int n) {
if (!font_descriptor()) return -1;
+ if ((str == NULL) || (n == 0)) return 0.;
if (n == fl_utf8len(*str)) { // str contains a single unicode character
int l;
unsigned c = fl_utf8decode(str, str+n, &l);