From cd95c539516127b153ab21b57a1ceaa0e731ec4c Mon Sep 17 00:00:00 2001 From: Daiki Ueno Date: Mon, 16 May 2016 17:35:13 +0900 Subject: javascript: Avoid uninitialized variable * gettext-tools/src/format-javascript.c (format_check): Fix loop initialization. Spotted by clang-analyzer. --- gettext-tools/src/format-javascript.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gettext-tools/src/format-javascript.c b/gettext-tools/src/format-javascript.c index 44814de..c9c3d32 100644 --- a/gettext-tools/src/format-javascript.c +++ b/gettext-tools/src/format-javascript.c @@ -343,7 +343,7 @@ format_check (void *msgid_descr, void *msgstr_descr, bool equality, /* Check the argument names are the same. Both arrays are sorted. We search for the first difference. */ - for (i = 0; i < spec2->numbered_arg_count; i++) + for (i = 0, j = 0; i < n1 || j < n2; ) { int cmp = (i >= n1 ? 1 : j >= n2 ? -1 : -- cgit v1.1