mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-31 21:21:08 +00:00
Check null pointer for arguments of Unicode conversion util functions,
bug 151769, r=ducarroz, sr=bienvenu.
This commit is contained in:
parent
a1cd8f96db
commit
006d4e404b
@ -218,13 +218,8 @@ nsresult ConvertFromUnicode(const char* aCharset,
|
||||
const nsString& inString,
|
||||
char** outCString)
|
||||
{
|
||||
#if 0
|
||||
nsCAutoString s;
|
||||
nsresult rv;
|
||||
rv = nsMsgI18NConvertFromUnicode(aCharset, inString, s);
|
||||
*outCString = PL_strdup(s);
|
||||
return rv;
|
||||
#endif
|
||||
NS_ENSURE_ARG_POINTER(aCharset);
|
||||
NS_ENSURE_ARG_POINTER(outCString);
|
||||
|
||||
*outCString = NULL;
|
||||
|
||||
@ -294,16 +289,10 @@ nsresult ConvertToUnicode(const char* aCharset,
|
||||
const char* inCString,
|
||||
nsString& outString)
|
||||
{
|
||||
#if 0
|
||||
nsresult rv;
|
||||
rv = nsMsgI18NConvertToUnicode(aCharset, nsCAutoString(inCString), outString);
|
||||
return rv;
|
||||
#endif
|
||||
NS_ENSURE_ARG_POINTER(aCharset);
|
||||
NS_ENSURE_ARG_POINTER(inCString);
|
||||
|
||||
if (NULL == inCString) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
else if ('\0' == *inCString) {
|
||||
if ('\0' == *inCString) {
|
||||
outString.Truncate();
|
||||
return NS_OK;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user