summary refs log tree commit diff
path: root/parse.y
diff options
context:
space:
mode:
authorokan <okan>2018-02-02 13:27:25 +0000
committerokan <okan>2018-02-02 13:27:25 +0000
commit9bf750b0549f10fdd4f5898dbab40ad4c946eee6 (patch)
tree29582e4653a13df95a27f36f3fab2d28b908466e /parse.y
parent174537f29e4735799f5cafd29e34bb31f831f9b3 (diff)
downloadcwm-9bf750b0549f10fdd4f5898dbab40ad4c946eee6.tar.gz
cwm-9bf750b0549f10fdd4f5898dbab40ad4c946eee6.tar.xz
cwm-9bf750b0549f10fdd4f5898dbab40ad4c946eee6.zip
Simplification; use asprintf where appropriate now.
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y10
1 files changed, 6 insertions, 4 deletions
diff --git a/parse.y b/parse.y
index fbc19ed..6c4a556 100644
--- a/parse.y
+++ b/parse.y
@@ -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);
 		}