Bug 717526 - fix warning of nsStringAPI.h on Win64. r=dbaron

This commit is contained in:
Makoto Kato 2012-01-25 15:43:27 +09:00
parent a1c3f8065a
commit 8a1baaa906

View File

@ -1322,7 +1322,8 @@ Substring( const nsAString& str, PRUint32 startPos, PRUint32 length )
inline const nsDependentSubstring
Substring( const PRUnichar* start, const PRUnichar* end )
{
return nsDependentSubstring(start, end - start);
NS_ABORT_IF_FALSE(PRUint32(end - start) == end - start, "string too long");
return nsDependentSubstring(start, PRUint32(end - start));
}
inline const nsDependentSubstring
@ -1360,7 +1361,8 @@ inline
const nsDependentCSubstring
Substring( const char* start, const char* end )
{
return nsDependentCSubstring(start, end - start);
NS_ABORT_IF_FALSE(PRUint32(end - start) == end - start, "string too long");
return nsDependentCSubstring(start, PRUint32(end - start));
}
inline