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

E341 happen with empty clipboard.

Expand Messages
  • Yasuhiro Matsumoto
    E341 happen with empty clipboard( ) on win32. Bram, Please check. ... *************** *** 862,868 **** LPWSTR *out, int *outlen) { *outlen =
    Message 1 of 2 , May 2, 2003
    • 0 Attachment
      E341 happen with empty clipboard("") on win32.
      Bram, Please check.

      *** src/os_mswin.c~ Fri May 02 20:04:31 2003
      --- src/os_mswin.c Fri May 02 20:05:27 2003
      ***************
      *** 862,868 ****
      LPWSTR *out, int *outlen)
      {
      *outlen = MultiByteToWideChar(cp, flags, in, inlen, 0, 0);
      ! *out = (LPWSTR)alloc(sizeof(WCHAR) * *outlen);
      if (*out != NULL)
      MultiByteToWideChar(cp, flags, in, inlen, *out, *outlen);
      }
      --- 862,869 ----
      LPWSTR *out, int *outlen)
      {
      *outlen = MultiByteToWideChar(cp, flags, in, inlen, 0, 0);
      ! if (*outlen)
      ! *out = (LPWSTR)alloc(sizeof(WCHAR) * *outlen);
      if (*out != NULL)
      MultiByteToWideChar(cp, flags, in, inlen, *out, *outlen);
      }
      ***************
      *** 878,884 ****
      LPCSTR def, LPBOOL useddef)
      {
      *outlen = WideCharToMultiByte(cp, flags, in, inlen, NULL, 0, def,
      useddef);
      ! *out = alloc((unsigned)*outlen);
      if (*out != NULL)
      WideCharToMultiByte(cp, flags, in, inlen, *out, *outlen, def, useddef);
      }
      --- 879,886 ----
      LPCSTR def, LPBOOL useddef)
      {
      *outlen = WideCharToMultiByte(cp, flags, in, inlen, NULL, 0, def,
      useddef);
      ! if (*outlen)
      ! *out = alloc((unsigned)*outlen);
      if (*out != NULL)
      WideCharToMultiByte(cp, flags, in, inlen, *out, *outlen, def, useddef);
      }
      --

      - Yasuhiro


      _________________________________________________________________
      The new MSN 8: smart spam protection and 2 months FREE*
      http://join.msn.com/?page=features/junkmail
    • Bram Moolenaar
      ... Thanks for the fix. I think it s slightly simpler to allocate an extra word or byte. This also avoids returning NULL when there is no real error. --
      Message 2 of 2 , May 2, 2003
      • 0 Attachment
        Yasuhiro Matsumoto wrote:

        > E341 happen with empty clipboard("") on win32.
        > Bram, Please check.

        Thanks for the fix. I think it's slightly simpler to allocate an extra
        word or byte. This also avoids returning NULL when there is no real
        error.

        --
        hundred-and-one symptoms of being an internet addict:
        152. You find yourself falling for someone you've never seen or hardly
        know, but, boy can he/she TYPE!!!!!!

        /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
        /// Creator of Vim - Vi IMproved -- http://www.Vim.org \\\
        \\\ Project leader for A-A-P -- http://www.A-A-P.org ///
        \\\ Help AIDS victims, buy at Amazon -- http://ICCF.nl/click1.html ///
      Your message has been successfully submitted and would be delivered to recipients shortly.