]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.0.1637: compiler warning for uninitialized variable v9.0.1637
authorChristian Brabandt <cb@256bit.org>
Fri, 16 Jun 2023 20:42:06 +0000 (21:42 +0100)
committerBram Moolenaar <Bram@vim.org>
Fri, 16 Jun 2023 20:42:06 +0000 (21:42 +0100)
Problem:    Compiler warning for uninitialized variable.
Solution:   Move the variable to an inner block and initialize it. (Christian
            Brabandt, closes #12549)

src/fileio.c
src/version.c

index d60e95ef200ff58d6f3bb081c47ebeac69aa78b2..4f3b895f2bf4ecf6e6a4815be7a18b859d4ccc11 100644 (file)
@@ -218,7 +218,6 @@ readfile(
     int                using_b_ffname;
     int                using_b_fname;
     static char *msg_is_a_directory = N_("is a directory");
-    int                eof;
 #ifdef FEAT_SODIUM
     int                may_need_lseek = FALSE;
 #endif
@@ -1223,13 +1222,13 @@ retry:
                    size -= conv_restlen;
                }
 
+               int eof = FALSE;
                if (read_buffer)
                {
                    /*
                     * Read bytes from curbuf.  Used for converting text read
                     * from stdin.
                     */
-                   eof = FALSE;
                    if (read_buf_lnum > from)
                        size = 0;
                    else
@@ -5477,7 +5476,7 @@ match_file_pat(
     int
 match_file_list(char_u *list, char_u *sfname, char_u *ffname)
 {
-    char_u     buf[100];
+    char_u     buf[MAXPATHL];
     char_u     *tail;
     char_u     *regpat;
     char       allow_dirs;
@@ -5490,7 +5489,7 @@ match_file_list(char_u *list, char_u *sfname, char_u *ffname)
     p = list;
     while (*p)
     {
-       copy_option_part(&p, buf, 100, ",");
+       copy_option_part(&p, buf, MAXPATHL, ",");
        regpat = file_pat_to_reg_pat(buf, NULL, &allow_dirs, FALSE);
        if (regpat == NULL)
            break;
index 6a70e21b7b28267cedfa25da0fe899c3d0603ba8..a91e6fb0e7d00c6233400a3827cb87496efdfb2c 100644 (file)
@@ -695,6 +695,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1637,
 /**/
     1636,
 /**/