diff options
author | okan <okan> | 2009-06-20 00:22:39 +0000 |
---|---|---|
committer | okan <okan> | 2009-06-20 00:22:39 +0000 |
commit | 58d12134b1679a9172a7131abffc27769780b9c5 (patch) | |
tree | ffd2aa13b869b39db64f2a18488c87bfc2aa9882 /kbfunc.c | |
parent | 18c7d89c985cda7a9a5fa7de7c13ae177509380b (diff) | |
download | cwm-58d12134b1679a9172a7131abffc27769780b9c5.tar.gz cwm-58d12134b1679a9172a7131abffc27769780b9c5.tar.xz cwm-58d12134b1679a9172a7131abffc27769780b9c5.zip |
unroll XCALLOC/XMALLOC macros; since we use xcalloc/xmalloc all over the
place anyway, this makes things a bit more consistent; from Thomas Pfaff ok oga@
Diffstat (limited to 'kbfunc.c')
-rw-r--r-- | kbfunc.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/kbfunc.c b/kbfunc.c index d7814ab..1f3b843 100644 --- a/kbfunc.c +++ b/kbfunc.c @@ -135,7 +135,7 @@ kbfunc_client_search(struct client_ctx *scratch, union arg *arg) TAILQ_INIT(&menuq); TAILQ_FOREACH(cc, &Clientq, entry) { - XCALLOC(mi, struct menu); + mi = xcalloc(1, sizeof(*mi)); strlcpy(mi->text, cc->name, sizeof(mi->text)); mi->ctx = cc; TAILQ_INSERT_TAIL(&menuq, mi, entry); @@ -168,7 +168,7 @@ kbfunc_menu_search(struct client_ctx *scratch, union arg *arg) TAILQ_INIT(&menuq); TAILQ_FOREACH(cmd, &Conf.cmdq, entry) { - XCALLOC(mi, struct menu); + mi = xcalloc(1, sizeof(*mi)); strlcpy(mi->text, cmd->label, sizeof(mi->text)); mi->ctx = cmd; TAILQ_INSERT_TAIL(&menuq, mi, entry); @@ -304,7 +304,7 @@ kbfunc_exec(struct client_ctx *scratch, union arg *arg) continue; executable: /* the thing in tpath, we may execute */ - XCALLOC(mi, struct menu); + mi = xcalloc(1, sizeof(*mi)); strlcpy(mi->text, dp->d_name, sizeof(mi->text)); TAILQ_INSERT_TAIL(&menuq, mi, entry); } @@ -380,7 +380,7 @@ kbfunc_ssh(struct client_ctx *scratch, union arg *arg) if (p - buf + 1 > sizeof(hostbuf)) continue; (void) strlcpy(hostbuf, buf, p - buf + 1); - XCALLOC(mi, struct menu); + mi = xcalloc(1, sizeof(*mi)); (void) strlcpy(mi->text, hostbuf, sizeof(mi->text)); TAILQ_INSERT_TAIL(&menuq, mi, entry); } |