r=pedemonte, sr=blizzard (platform specific), a=mkaply
adjust unicode return buffer lengths to work around OS/2 bug


git-svn-id: svn://10.0.0.236/trunk@149554 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
mkaply%us.ibm.com 2003-11-19 19:36:56 +00:00
parent 1b25ba4a6b
commit f58a09785f

View File

@ -1008,8 +1008,8 @@ NS_CopyNativeToUnicode(const nsACString &input, nsAString &output)
char *inputStr = (char*)flat.get();
size_t inputLen = flat.Length() + 1; // include null char
// assume worst case allocation
size_t resultLen = CCHMAXPATH;
// resultLen must be >= inputLen or the unicode conversion will fail
size_t resultLen = inputLen;
output.Truncate();
output.SetLength(resultLen);
@ -1047,8 +1047,8 @@ NS_CopyUnicodeToNative(const nsAString &input, nsACString &output)
UniChar *inputStr = (UniChar*)flat.get();
size_t inputLen = flat.Length() + 1; // include null char
// assume worst case allocation
size_t resultLen = CCHMAXPATH;
// resultLen must be >= inputLen or the unicode conversion will fail
size_t resultLen = inputLen;
output.Truncate();
output.SetLength(resultLen);