Corrected & refactored handling of window bar content...

Old snprintf calls could have overflowed the buffers.
This commit is contained in:
Bert Münnich
2014-10-01 22:35:22 +02:00
parent 8db3191f04
commit c33f2ad355
3 changed files with 67 additions and 41 deletions

View File

@ -49,6 +49,12 @@ typedef struct {
int depth;
} 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;