From b5cbd9e8958034b05e88fa8a1dfa381215fc2590 Mon Sep 17 00:00:00 2001 From: nicm Date: Wed, 15 Jan 2014 11:44:18 +0000 Subject: [PATCH] Couple of fixes from cppcheck via Tiago Cunha. --- usr.bin/tmux/arguments.c | 5 ++--- usr.bin/tmux/grid.c | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/usr.bin/tmux/arguments.c b/usr.bin/tmux/arguments.c index 46c012f3450..5d3fa331ce2 100644 --- a/usr.bin/tmux/arguments.c +++ b/usr.bin/tmux/arguments.c @@ -1,4 +1,4 @@ -/* $OpenBSD: arguments.c,v 1.7 2014/01/09 13:51:57 nicm Exp $ */ +/* $OpenBSD: arguments.c,v 1.8 2014/01/15 11:44:18 nicm Exp $ */ /* * Copyright (c) 2010 Nicholas Marriott @@ -78,7 +78,6 @@ struct args * args_parse(const char *template, int argc, char **argv) { struct args *args; - char *ptr; int opt; args = xcalloc(1, sizeof *args); @@ -89,7 +88,7 @@ args_parse(const char *template, int argc, char **argv) while ((opt = getopt(argc, argv, template)) != -1) { if (opt < 0) continue; - if (opt == '?' || (ptr = strchr(template, opt)) == NULL) { + if (opt == '?' || strchr(template, opt) == NULL) { args_free(args); return (NULL); } diff --git a/usr.bin/tmux/grid.c b/usr.bin/tmux/grid.c index fd856f4ce27..a1235799017 100644 --- a/usr.bin/tmux/grid.c +++ b/usr.bin/tmux/grid.c @@ -1,4 +1,4 @@ -/* $OpenBSD: grid.c,v 1.32 2014/01/09 13:58:06 nicm Exp $ */ +/* $OpenBSD: grid.c,v 1.33 2014/01/15 11:44:18 nicm Exp $ */ /* * Copyright (c) 2008 Nicholas Marriott @@ -124,7 +124,7 @@ grid_compare(struct grid *ga, struct grid *gb) struct grid_cell *gca, *gcb; u_int xx, yy; - if (ga->sx != gb->sx || ga->sy != ga->sy) + if (ga->sx != gb->sx || ga->sy != gb->sy) return (1); for (yy = 0; yy < ga->sy; yy++) { -- 2.20.1