diff options
author | Okan Demirmen <okan@cvs.openbsd.org> | 2014-09-06 18:50:44 +0000 |
---|---|---|
committer | Okan Demirmen <okan@cvs.openbsd.org> | 2014-09-06 18:50:44 +0000 |
commit | 23336b3ec55128eada42b5133af6ecd09e105ebc (patch) | |
tree | a478be585e3132977a5f82b0ae2de411f2991791 /app | |
parent | 38474ba9ae4415cb2a27f51fc6f2ed69fcc57820 (diff) |
Few style nits; extend 'path' to MAXPATHLEN.
Diffstat (limited to 'app')
-rw-r--r-- | app/cwm/kbfunc.c | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/app/cwm/kbfunc.c b/app/cwm/kbfunc.c index ec8bf49dc..6a4af74a0 100644 --- a/app/cwm/kbfunc.c +++ b/app/cwm/kbfunc.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: kbfunc.c,v 1.98 2014/09/06 16:14:35 okan Exp $ + * $OpenBSD: kbfunc.c,v 1.99 2014/09/06 18:50:43 okan Exp $ */ #include <sys/param.h> @@ -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) |