Ignore:
Timestamp:
Jan 9, 2017, 11:09:38 AM (2 years ago)
Author:
jrpelegrina
Message:

Update new version: 3.15.02

File:
1 edited

Legend:

Unmodified
Added
Removed
  • filezilla/trunk/fuentes/src/putty/windows/winsftp.c

    r130 r3185  
    3030 * File access abstraction.
    3131 */
    32 
    33 static wchar_t* utf8_to_wide(const char* utf8)
    34 {
    35     wchar_t *w;
    36 
    37     int len = MultiByteToWideChar(CP_UTF8, 0, utf8, -1, 0, 0);
    38     if (len <= 0)
    39         return NULL;
    40 
    41     w = snewn(len, wchar_t);
    42 
    43     if (!w)
    44         return NULL;
    45 
    46     if (MultiByteToWideChar(CP_UTF8, 0, utf8, -1, w, len) <= 0)
    47     {
    48         sfree(w);
    49         return NULL;
    50     }
    51 
    52     return w;
    53 }
    54 
    55 static char* wide_to_utf8(const wchar_t* w)
    56 {
    57     char* utf8;
    58 
    59     int len = WideCharToMultiByte(CP_UTF8, 0, w, -1, 0, 0, 0, 0);
    60     if (len <= 0)
    61         return NULL;
    62 
    63     utf8 = snewn(len, char);
    64 
    65     if (!utf8)
    66         return NULL;
    67 
    68     if (WideCharToMultiByte(CP_UTF8, 0, w, -1, utf8, len, 0, 0) <= 0)
    69     {
    70         sfree(utf8);
    71         return NULL;
    72     }
    73    
    74     return utf8;
    75 }
    7632
    7733/*
Note: See TracChangeset for help on using the changeset viewer.