Closed
Bug 8125
Opened 26 years ago
Closed 26 years ago
nsString2::ToInteger fails to set error code
Categories
(Core :: Layout, defect, P3)
Tracking
()
VERIFIED
FIXED
People
(Reporter: sfraser_bugs, Assigned: rickg)
Details
Attachments
(1 file)
494 bytes,
patch
|
Details | Diff | Splinter Review |
On investigating the window sizing problem in apprunning, I notice that
PRInt32 nsString2::ToInteger(PRInt32* anErrorCode) fails to set the error
code in some cases.
The implemenation looks like:
{
nsAutoString2 theString(*this,eOneByte);
PRUint32 theRadix=10;
PRInt32 result=GetNumericSubstring(theString,theRadix);
if(NS_OK==result){
result=_ToInteger(theString,anErrorCode,theRadix);
}
return result;
}
If called on an empty string, GetNumericSubstring() returns an error
code, but this is never set in *anErrorCode before return. So in this
situation, *anErrorCode is left unset, and the function returns a large
negative value.
Reporter | ||
Comment 1•26 years ago
|
||
Status: NEW → RESOLVED
Closed: 26 years ago
Resolution: --- → FIXED
Added more error reporting to this method. In particular, if you hand in a plain
text string, or an empty string you'll get an error code.
Comment 3•26 years ago
|
||
Rick- I would verify this fix in the latest build. Can I verify this with a test
case ?
Updated•26 years ago
|
Status: RESOLVED → VERIFIED
Comment 4•26 years ago
|
||
Marking verified fixed.
You need to log in
before you can comment on or make changes to this bug.
Description
•