]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
javascript: Avoid uninitialized variable
authorDaiki Ueno <ueno@gnu.org>
Mon, 16 May 2016 08:35:13 +0000 (17:35 +0900)
committerDaiki Ueno <ueno@gnu.org>
Mon, 16 May 2016 08:37:32 +0000 (17:37 +0900)
* gettext-tools/src/format-javascript.c (format_check): Fix
loop initialization.  Spotted by clang-analyzer.

gettext-tools/src/format-javascript.c

index 44814de900d1154404c38004a3a42263fbe55136..c9c3d3272b40e5b5a2eb39e0bb5883aac02967d8 100644 (file)
@@ -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 :