summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornicm <nicm>2014-01-15 11:44:18 +0000
committernicm <nicm>2014-01-15 11:44:18 +0000
commit3368b602a868eb6570c4ee92f45c2e0ee78631cb (patch)
treee2c162ef1b2e2d91bf51e6497714c7064b96c830
parentb185449d073b376eb305ff2a68d87fd82ed56377 (diff)
Couple of fixes from cppcheck via Tiago Cunha.
-rw-r--r--arguments.c3
-rw-r--r--grid.c2
2 files changed, 2 insertions, 3 deletions
diff --git a/arguments.c b/arguments.c
index 4a3f4579..5ff7ed2c 100644
--- a/arguments.c
+++ b/arguments.c
@@ -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/grid.c b/grid.c
index d9b3c716..852423b5 100644
--- a/grid.c
+++ b/grid.c
@@ -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++) {