From: Rob Browning Date: Sat, 5 Jun 2021 17:18:02 +0000 (-0500) Subject: get_argv: declare loop variable outside for() X-Git-Url: https://arthur.barton.de/gitweb/?a=commitdiff_plain;h=242f693bdf3a2e1c3ab1bbae1eb50a8da0506f44;hp=c6359456fc873daed24d85b1370554c00362c579;p=bup.git get_argv: declare loop variable outside for() Don't require a newer compiler/standard. Signed-off-by: Rob Browning Tested-by: Rob Browning --- diff --git a/lib/cmd/bup.c b/lib/cmd/bup.c index f85029a..bc60f76 100644 --- a/lib/cmd/bup.c +++ b/lib/cmd/bup.c @@ -35,7 +35,8 @@ get_argv(PyObject *self, PyObject *args) return NULL; PyObject *result = PyList_New(prog_argc); - for (int i = 0; i < prog_argc; i++) { + int i; + for (i = 0; i < prog_argc; i++) { PyObject *s = PyBytes_FromString(prog_argv[i]); if (!s) die(2, "cannot convert argument to bytes: %s\n", prog_argv[i]);