Ticket #11057: string_conversions.patch

File string_conversions.patch, 745 bytes (added by Paolo Zambotti, 8 years ago)

patch file

  • libfilezilla_svn/lib/string.cpp

     
    9090    std::wstring ret;
    9191
    9292    char const* in_p = in.c_str();
    93     size_t len = std::mbsrtowcs(0, &in_p, 0, &ps);
     93    size_t len = std::mbsrtowcs(nullptr, &in_p, -1, &ps);
    9494    if (len != static_cast<size_t>(-1)) {
    9595        ret.resize(len);
    9696        wchar_t* out_p = &ret[0];
     
    205205    std::string ret;
    206206
    207207    wchar_t const* in_p = in.c_str();
    208     size_t len = std::wcsrtombs(0, &in_p, 0, &ps);
     208    size_t len = std::wcsrtombs(nullptr, &in_p, -1, &ps);
    209209    if (len != static_cast<size_t>(-1)) {
    210210        ret.resize(len);
    211211        char* out_p = &ret[0];