summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/WindowState.cc13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/WindowState.cc b/src/WindowState.cc
index 50a88fc..1b8647a 100644
--- a/src/WindowState.cc
+++ b/src/WindowState.cc
@@ -23,7 +23,8 @@
23 23
24#include "FbTk/StringUtil.hh" 24#include "FbTk/StringUtil.hh"
25 25
26#include <stdlib.h> 26#include <cstdlib>
27#include <errno.h>
27 28
28bool WindowState::useBorder() const { 29bool WindowState::useBorder() const {
29 return !fullscreen && maximized != MAX_FULL && deco_mask & DECORM_BORDER; 30 return !fullscreen && maximized != MAX_FULL && deco_mask & DECORM_BORDER;
@@ -92,10 +93,14 @@ int WindowState::getDecoMaskFromString(const std::string &str_label) {
92 return DECOR_BORDER; 93 return DECOR_BORDER;
93 if (label == "tab") 94 if (label == "tab")
94 return DECOR_TAB; 95 return DECOR_TAB;
96
95 int mask = -1; 97 int mask = -1;
96 if ((str_label.size() > 1 && str_label[0] == '0' && str_label[1] == 'x') || 98 int tmp;
97 (str_label.size() > 0 && isdigit(str_label[0]))) 99 errno = 0;
98 mask = strtol(str_label.c_str(), NULL, 0); 100 tmp = strtol(str_label.c_str(), NULL, 0);
101 if (errno == 0)
102 mask = tmp;
103
99 return mask; 104 return mask;
100} 105}
101 106