From c6af5e9b967797d315037b26aa05fec5b3e6ef44 Mon Sep 17 00:00:00 2001 From: okan Date: Sat, 20 Jun 2009 00:22:39 +0000 Subject: 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@ --- kbfunc.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'kbfunc.c') diff --git a/kbfunc.c b/kbfunc.c index 3231190..a205c83 100644 --- a/kbfunc.c +++ b/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. * - * $Id: kbfunc.c,v 1.38 2009/05/17 17:04:59 sthen Exp $ + * $Id: kbfunc.c,v 1.39 2009/06/20 00:22:39 okan Exp $ */ #include @@ -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); } -- cgit v1.2.3-2-gb3c3