Skip to content

Commit

Permalink
Initialize hasLoss before passing into Convert function (#919)
Browse files Browse the repository at this point in the history
  • Loading branch information
yitam authored Jan 21, 2019
1 parent d6c8cc2 commit 04f531d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions source/shared/localizationimpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@ size_t SystemLocale::ToUtf16( UINT srcCodePage, const char * src, SSIZE_T cchSrc
return 0;
}
size_t cchSrcActual = (cchSrc < 0 ? (1+strnlen_s(src)) : cchSrc);
bool hasLoss;
bool hasLoss = false;
return cvt.Convert( dest, cchDest, src, cchSrcActual, false, &hasLoss, pErrorCode );
}

Expand All @@ -664,7 +664,7 @@ size_t SystemLocale::ToUtf16Strict( UINT srcCodePage, const char * src, SSIZE_T
return 0;
}
size_t cchSrcActual = (cchSrc < 0 ? (1+strnlen_s(src)) : cchSrc);
bool hasLoss;
bool hasLoss = false;
return cvt.Convert( dest, cchDest, src, cchSrcActual, true, &hasLoss, pErrorCode );
}

Expand Down Expand Up @@ -952,7 +952,7 @@ size_t SystemLocale::FromUtf16( UINT destCodePage, const WCHAR * src, SSIZE_T cc
return 0;
}
size_t cchSrcActual = (cchSrc < 0 ? (1+mplat_wcslen(src)) : cchSrc);
bool hasLoss;
bool hasLoss = false;
return cvt.Convert( dest, cchDest, src, cchSrcActual, false, &hasLoss, pErrorCode );
}

Expand All @@ -972,7 +972,7 @@ size_t SystemLocale::FromUtf16Strict(UINT destCodePage, const WCHAR * src, SSIZE
return 0;
}
size_t cchSrcActual = (cchSrc < 0 ? (1 + mplat_wcslen(src)) : cchSrc);
bool hasLoss;
bool hasLoss = false;
return cvt.Convert(dest, cchDest, src, cchSrcActual, true, &hasLoss, pErrorCode);
}

Expand Down

0 comments on commit 04f531d

Please sign in to comment.