From e75cc411641b8eb24c28ef0ebb449542467ed622 Mon Sep 17 00:00:00 2001 From: Michael Vetter Date: Mon, 22 Jul 2019 13:56:03 +0200 Subject: [PATCH] Fix double initialization of loop iterator --- src/command/cmd_defs.c | 1 - src/plugins/python_api.c | 2 -- 2 files changed, 3 deletions(-) diff --git a/src/command/cmd_defs.c b/src/command/cmd_defs.c index 2dca64c0..efe2bad0 100644 --- a/src/command/cmd_defs.c +++ b/src/command/cmd_defs.c @@ -2427,7 +2427,6 @@ _cmd_index(Command *cmd) { g_string_free(index_source, TRUE); GString *index = g_string_new(""); - i = 0; for (i = 0; i < g_strv_length(tokens); i++) { index = g_string_append(index, tokens[i]); index = g_string_append(index, " "); diff --git a/src/plugins/python_api.c b/src/plugins/python_api.c index 99a96634..140b4abd 100644 --- a/src/plugins/python_api.c +++ b/src/plugins/python_api.c @@ -159,7 +159,6 @@ python_api_register_command(PyObject *self, PyObject *args) Py_ssize_t args_len = PyList_Size(arguments); char *c_arguments[args_len == 0 ? 0 : args_len+1][2]; - i = 0; for (i = 0; i < args_len; i++) { PyObject *item = PyList_GetItem(arguments, i); Py_ssize_t len2 = PyList_Size(item); @@ -180,7 +179,6 @@ python_api_register_command(PyObject *self, PyObject *args) len = PyList_Size(examples); char *c_examples[len == 0 ? 0 : len+1]; - i = 0; for (i = 0; i < len; i++) { PyObject *item = PyList_GetItem(examples, i); char *c_item = python_str_or_unicode_to_string(item);