aboutsummaryrefslogtreecommitdiffstats
path: root/conf.c
diff options
context:
space:
mode:
authorokan2014-01-28 20:22:21 +0000
committerokan2014-01-28 20:22:21 +0000
commit673041f76297706b7679f3140891e8ab1dd548d8 (patch)
tree85398b8704571fcfd2e3d2a6e48731da6981bc05 /conf.c
parent21714a7f2eed869303044cb99686fe0f0a38267a (diff)
downloadcwm-673041f76297706b7679f3140891e8ab1dd548d8.tar.gz
Check ignore windowname for truncation and provide user feedback during
config parse; based on a discussion with Tiago Cunha.
Diffstat (limited to '')
-rw-r--r--conf.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/conf.c b/conf.c
index 9f05d9e..a2ac6b8 100644
--- a/conf.c
+++ b/conf.c
@@ -15,7 +15,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $OpenBSD: conf.c,v 1.162 2014/01/23 17:13:38 okan Exp $
+ * $OpenBSD: conf.c,v 1.163 2014/01/28 20:22:21 okan Exp $
*/
#include <sys/param.h>
@@ -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[] = {