diff options
Diffstat (limited to '')
-rw-r--r-- | parse.y | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.69 2017/12/29 20:03:46 okan Exp $ */ +/* $OpenBSD: parse.y,v 1.70 2018/02/02 13:27:25 okan Exp $ */ /* * Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -137,22 +137,24 @@ main : FONTNAME STRING { conf->snapdist = $2; } | COMMAND STRING string { - if (!conf_cmd_add(conf, $2, $3)) { - yyerror("command name/path too long"); + if (strlen($3) >= PATH_MAX) { + yyerror("%s command path too long", $2); free($2); free($3); YYERROR; } + conf_cmd_add(conf, $2, $3); free($2); free($3); } | WM STRING string { - if (!conf_wm_add(conf, $2, $3)) { - yyerror("wm name/path too long"); + if (strlen($3) >= PATH_MAX) { + yyerror("%s wm path too long", $2); free($2); free($3); YYERROR; } + conf_wm_add(conf, $2, $3); free($2); free($3); } |