summaryrefslogtreecommitdiffstats
path: root/window.h
diff options
context:
space:
mode:
authorBert Münnich <ber.t@posteo.de>2014-10-01 22:35:22 +0200
committerBert Münnich <ber.t@posteo.de>2014-10-01 22:35:22 +0200
commitc33f2ad355a291cb1a919074ceaa25f52bc85b76 (patch)
treea9b57f51e63e6095e6d16cb5fd219d684a3e1c98 /window.h
parent8db3191f04d52929ec10b1412d282a4ac4cf5240 (diff)
downloadnsxiv-c33f2ad355a291cb1a919074ceaa25f52bc85b76.tar.zst
Corrected & refactored handling of window bar content...
Old snprintf calls could have overflowed the buffers.
Diffstat (limited to 'window.h')
-rw-r--r--window.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/window.h b/window.h
index 1178007..8761120 100644
--- a/window.h
+++ b/window.h
@@ -50,6 +50,12 @@ typedef struct {
} win_env_t;
typedef struct {
+ size_t size;
+ char *p;
+ char *buf;
+} win_bar_t;
+
+typedef struct {
Window xwin;
win_env_t env;
@@ -73,8 +79,8 @@ typedef struct {
struct {
unsigned int h;
- char l[BAR_L_LEN];
- char r[BAR_R_LEN];
+ win_bar_t l;
+ win_bar_t r;
unsigned long bgcol;
unsigned long fgcol;
} bar;