diff -r a1e347446159 -r 28ccaba883f4 utilitylibraries/libutils/src/wchartodescriptor16.cpp --- a/utilitylibraries/libutils/src/wchartodescriptor16.cpp Fri Sep 17 19:25:42 2010 +0530 +++ b/utilitylibraries/libutils/src/wchartodescriptor16.cpp Wed Oct 13 19:39:18 2010 +0530 @@ -57,7 +57,7 @@ * reference to the descriptor where the result of conversion * is stored * @return Status code (0 is ESuccess, -1 is EInsufficientMemory, - * -3 is EStringNoData ) + * -3 is EStringNoData, -6 is EUseNewMaxL ) */ EXPORT_C int WcharToHbufc16 (const wchar_t* aSrc ,HBufC16* aDes ) @@ -143,7 +143,8 @@ * @param aSrc is the wchar to be converted , aDes is the * reference to the descriptor where the result of conversion * is stored - * @return Status code (0 is ESuccess ,-1 is EInsufficientMemory -3 is EStringNoData ) + * @return Status code (0 is ESuccess ,-1 is EInsufficientMemory, + * -3 is EStringNoData, -4 is EInvalidPointer ) */ EXPORT_C int WcharToRbuf16(const wchar_t* aSrc, RBuf16& aDes) @@ -157,15 +158,8 @@ } wlen = wcslen(aSrc); - - if (KErrNone == aDes.Create(wlen)) - { - aDes.Copy((const unsigned short *)aSrc, wlen); - } - else - { - retval = EInsufficientSystemMemory; - } - + + aDes.Copy((const unsigned short *)aSrc, wlen); + return retval; }