summaryrefslogtreecommitdiffstats
path: root/StdLib/LibC/Main
diff options
context:
space:
mode:
authordarylm503 <darylm503@6f19259b-4bc3-4df7-8a09-765794883524>2012-10-05 22:00:43 +0000
committerdarylm503 <darylm503@6f19259b-4bc3-4df7-8a09-765794883524>2012-10-05 22:00:43 +0000
commitc42c9cac8c289acc7af256e4578b116cbb576054 (patch)
tree506cd5ccae6ccda1ec2574003acb54e969ec63b1 /StdLib/LibC/Main
parente2a013fa404b095dbf4240fd122d6420021f848e (diff)
downloadedk2-c42c9cac8c289acc7af256e4578b116cbb576054.tar.gz
edk2-c42c9cac8c289acc7af256e4578b116cbb576054.tar.bz2
edk2-c42c9cac8c289acc7af256e4578b116cbb576054.zip
StdLib: Fix several problems where characters were not being correctly converted between wide and MBCS.
Add utility functions for determining character length of strings. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: daryl.mcdaniel@intel.com Reviewed-by: erik.c.bjorge@intel.com Reviewed-by: lee.g.rosenbaum@intel.com StdLib/LibC/ Locale/multibyte_Utf8.c Improve comments. Define implementation-specific MBCS utility functions, as declared in <stdlib.h>. Enhance functionality of EncodeUtf8() and improve error handling. Set correct conversion state in wcrtomb(). Bug fixes in wcsrtombs(). Make wctob() properly MBCS compliant. Main/Main.c Remove code obsoleted by new wcsrtombs() implementation. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13785 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'StdLib/LibC/Main')
-rw-r--r--StdLib/LibC/Main/Main.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/StdLib/LibC/Main/Main.c b/StdLib/LibC/Main/Main.c
index 523965fa43..9afffff7c6 100644
--- a/StdLib/LibC/Main/Main.c
+++ b/StdLib/LibC/Main/Main.c
@@ -113,10 +113,9 @@ DEBUG_CODE_END();
for(count = 0; count < Argc; ++count) {
nArgv[count] = string;
AVsz = wcstombs(string, Argv[count], nArgvSize);
- string[AVsz] = 0; /* NULL terminate the argument */
DEBUG((DEBUG_INFO, "Cvt[%d] %d \"%s\" --> \"%a\"\n", (INT32)count, (INT32)AVsz, Argv[count], nArgv[count]));
- string += AVsz + 1;
- nArgvSize -= AVsz + 1;
+ string += AVsz;
+ nArgvSize -= AVsz;
if(nArgvSize < 0) {
Print(L"ABORTING: Internal Argv[%d] conversion error.\n", count);
exit(EXIT_FAILURE);