diff options
author | okan <okan> | 2014-01-28 20:22:21 +0000 |
---|---|---|
committer | okan <okan> | 2014-01-28 20:22:21 +0000 |
commit | c28467cda5323f2251ed16a407fd77b7ec9e5ba6 (patch) | |
tree | a9b96f700a88b5d5e7532735655df1fdd7a572d5 /conf.c | |
parent | df15337a9f180e41d5489ad9d45fc39ed3cdd335 (diff) | |
download | cwm-c28467cda5323f2251ed16a407fd77b7ec9e5ba6.tar.gz cwm-c28467cda5323f2251ed16a407fd77b7ec9e5ba6.tar.xz cwm-c28467cda5323f2251ed16a407fd77b7ec9e5ba6.zip |
Check ignore windowname for truncation and provide user feedback during
config parse; based on a discussion with Tiago Cunha.
Diffstat (limited to 'conf.c')
-rw-r--r-- | conf.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/conf.c b/conf.c index fce37ab..9ecf1b4 100644 --- a/conf.c +++ b/conf.c @@ -73,16 +73,18 @@ conf_autogroup(struct conf *c, int no, const char *val) TAILQ_INSERT_TAIL(&c->autogroupq, aw, entry); } -void +int conf_ignore(struct conf *c, const char *val) { struct winmatch *wm; wm = xcalloc(1, sizeof(*wm)); - (void)strlcpy(wm->title, val, sizeof(wm->title)); + if (strlcpy(wm->title, val, sizeof(wm->title)) >= sizeof(wm->title)) + return (0); TAILQ_INSERT_TAIL(&c->ignoreq, wm, entry); + return (1); } static const char *color_binds[] = { |