summary refs log tree commit diff
path: root/kbfunc.c
diff options
context:
space:
mode:
authorokan <okan>2014-09-06 18:50:43 +0000
committerokan <okan>2014-09-06 18:50:43 +0000
commitf7af0ebd7267cdfd4e7b9c12bb910992f1a094e5 (patch)
tree2e61da4f2f643c7b9c5671435f03de38ff127b81 /kbfunc.c
parent977992626a092487f4d5df364729693ad2be0131 (diff)
downloadcwm-f7af0ebd7267cdfd4e7b9c12bb910992f1a094e5.tar.gz
cwm-f7af0ebd7267cdfd4e7b9c12bb910992f1a094e5.tar.xz
cwm-f7af0ebd7267cdfd4e7b9c12bb910992f1a094e5.zip
Few style nits; extend 'path' to MAXPATHLEN.
Diffstat (limited to 'kbfunc.c')
-rw-r--r--kbfunc.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/kbfunc.c b/kbfunc.c
index dff75dc..81133b2 100644
--- a/kbfunc.c
+++ b/kbfunc.c
@@ -215,9 +215,10 @@ kbfunc_term(struct client_ctx *cc, union arg *arg)
 {
 	struct cmd *cmd;
 
-	TAILQ_FOREACH(cmd, &Conf.cmdq, entry)
+	TAILQ_FOREACH(cmd, &Conf.cmdq, entry) {
 		if (strcmp(cmd->name, "term") == 0)
 			u_spawn(cmd->path);
+	}
 }
 
 void
@@ -225,9 +226,10 @@ kbfunc_lock(struct client_ctx *cc, union arg *arg)
 {
 	struct cmd *cmd;
 
-	TAILQ_FOREACH(cmd, &Conf.cmdq, entry)
+	TAILQ_FOREACH(cmd, &Conf.cmdq, entry) {
 		if (strcmp(cmd->name, "lock") == 0)
 			u_spawn(cmd->path);
+	}
 }
 
 void
@@ -317,13 +319,13 @@ void
 kbfunc_ssh(struct client_ctx *cc, union arg *arg)
 {
 	struct screen_ctx	*sc = cc->sc;
-	struct cmd		*cmdq;
+	struct cmd		*cmd;
 	struct menu		*mi;
 	struct menu_q		 menuq;
 	FILE			*fp;
 	char			*buf, *lbuf, *p;
 	char			 hostbuf[MAXHOSTNAMELEN];
-	char			 cmd[256];
+	char			 path[MAXPATHLEN];
 	int			 l;
 	size_t			 len;
 
@@ -332,9 +334,10 @@ kbfunc_ssh(struct client_ctx *cc, union arg *arg)
 		return;
 	}
 
-	TAILQ_FOREACH(cmdq, &Conf.cmdq, entry)
-		if (strcmp(cmdq->name, "term") == 0)
+	TAILQ_FOREACH(cmd, &Conf.cmdq, entry) {
+		if (strcmp(cmd->name, "term") == 0)
 			break;
+	}
 
 	TAILQ_INIT(&menuq);
 
@@ -368,10 +371,10 @@ kbfunc_ssh(struct client_ctx *cc, union arg *arg)
 	    search_match_exec, NULL)) != NULL) {
 		if (mi->text[0] == '\0')
 			goto out;
-		l = snprintf(cmd, sizeof(cmd), "%s -T '[ssh] %s' -e ssh %s",
-		    cmdq->path, mi->text, mi->text);
-		if (l != -1 && l < sizeof(cmd))
-			u_spawn(cmd);
+		l = snprintf(path, sizeof(path), "%s -T '[ssh] %s' -e ssh %s",
+		    cmd->path, mi->text, mi->text);
+		if (l != -1 && l < sizeof(path))
+			u_spawn(path);
 	}
 out:
 	if (mi != NULL && mi->dummy)