diff options
author | darylm503 <darylm503@6f19259b-4bc3-4df7-8a09-765794883524> | 2013-05-15 01:59:11 +0000 |
---|---|---|
committer | darylm503 <darylm503@6f19259b-4bc3-4df7-8a09-765794883524> | 2013-05-15 01:59:11 +0000 |
commit | 5a5221122bffbaa6488f6e12e7b4b41cae832cb2 (patch) | |
tree | 8c2b3f54a2bb0f2ef7bf4c62c06791dff9f4d263 /EmulatorPkg | |
parent | 4c43e8526bda143cfb8631a0555dd59ee2b93eed (diff) | |
download | edk2-5a5221122bffbaa6488f6e12e7b4b41cae832cb2.zip edk2-5a5221122bffbaa6488f6e12e7b4b41cae832cb2.tar.gz edk2-5a5221122bffbaa6488f6e12e7b4b41cae832cb2.tar.bz2 |
StdLib/LibC/Locale/multibyte_Utf8.c: Fix obscure corner cases in wide to multibyte and multibyte to wide character conversions. The majority of problems center around the interpretation of the Length or Limit parameter when the Destination parameter is NULL.
DecodeOneStateful: Properly handle combinations of Src, Dest, or Len being NULL or 0.
EncodeUtf8: Do not zero-terminate the result string in this worker function.
mbsrtowcs: Remove test for **src == '\0', as per ISO/IEC 9899:199409. Allows "".
wcsrtombs: The C Language standard, ISO/IEC 9899:199409, states that the wcsrtombs() function will stop before encountering the terminating NUL character only if Dest is NOT NULL. This implies that if Dest is NULL, the Limit parameter will be ignored. In order to avoid system hangs, if Dest is NULL a Limit value of ASCII_STRING_MAX is automatically used. Also fixed a typo in the function header comment.
With these changes, StdLib now passes all of the C Language Standards Compliance Tests for ISO/IEC 9899:199409 (C95).
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: daryl.mcdaniel@intel.com
Reviewed-by: erik.c.bjorge@intel.com
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14358 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'EmulatorPkg')
0 files changed, 0 insertions, 0 deletions