Loading ...
Sorry, an error occurred while loading the content.

Use of uninitialized variable

Expand Messages
  • Yukihiro Nakadaira
    In the following code, n and p can be used without initialization. diff -r 3f65dc9c8840 src/os_win32.c ... +++ b/src/os_win32.c Mon Jul 22 22:32:43 2013
    Message 1 of 2 , Jul 22, 2013
    • 0 Attachment
      In the following code, n and p can be used without initialization.

      diff -r 3f65dc9c8840 src/os_win32.c
      --- a/src/os_win32.c    Sun Jul 21 18:59:24 2013 +0200
      +++ b/src/os_win32.c    Mon Jul 22 22:32:43 2013 +0900
      @@ -2728,21 +2728,26 @@
       {
           long    n;
       #ifdef FEAT_MBYTE
      -    WCHAR *p;
           if (enc_codepage >= 0 && (int)GetACP() != enc_codepage)
           {
      -    p = enc_to_utf16(name, NULL);
      +    WCHAR *p = enc_to_utf16(name, NULL);
       
           if (p != NULL)
           {
               n = _wchmod(p, perm);
               vim_free(p);
      -        if (n == -1 && GetLastError() != ERROR_CALL_NOT_IMPLEMENTED)
      -        return FAIL;
      -        /* Retry with non-wide function (for Windows 98). */
      +        if (n == -1)
      +        {
      +        if (GetLastError() != ERROR_CALL_NOT_IMPLEMENTED)
      +            return FAIL;
      +        /* Retry with non-wide function (for Windows 98). */
      +        n = _chmod(name, perm);
      +        }
           }
      +    else
      +        n = _chmod(name, perm);
           }
      -    if (p == NULL)
      +    else
       #endif
           n = _chmod(name, perm);
           if (n == -1)


      --
      Yukihiro Nakadaira - yukihiro.nakadaira@...

      --
      --
      You received this message from the "vim_dev" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php
       
      ---
      You received this message because you are subscribed to the Google Groups "vim_dev" group.
      To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
      For more options, visit https://groups.google.com/groups/opt_out.
       
       
    • Bram Moolenaar
      ... Thanks. I ll put it at the top of the todo list. -- The Feynman problem solving Algorithm: 1) Write down the problem 2) Think real hard 3) Write down the
      Message 2 of 2 , Jul 22, 2013
      • 0 Attachment
        Yukihiro Nakadaira wrote:

        > In the following code, n and p can be used without initialization.

        Thanks. I'll put it at the top of the todo list.


        --
        The Feynman problem solving Algorithm:
        1) Write down the problem
        2) Think real hard
        3) Write down the answer

        /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
        /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
        \\\ an exciting new programming language -- http://www.Zimbu.org ///
        \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

        --
        --
        You received this message from the "vim_dev" maillist.
        Do not top-post! Type your reply below the text you are replying to.
        For more information, visit http://www.vim.org/maillist.php

        ---
        You received this message because you are subscribed to the Google Groups "vim_dev" group.
        To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
        For more options, visit https://groups.google.com/groups/opt_out.
      Your message has been successfully submitted and would be delivered to recipients shortly.