Closed
Bug 30391
Opened 25 years ago
Closed 25 years ago
Unsafe PR_ABS
Categories
(Core :: Layout, defect, P3)
Tracking
()
VERIFIED
FIXED
People
(Reporter: rbs, Assigned: troy)
References
()
Details
nsTextFrame.cpp has the following declaration:
70 #ifndef PR_ABS
71 #define PR_ABS(x) (x < 0 ? -x : x)
72 #endif
and PR_ABS is later used as:
if (found) {
2033 PRInt32 charWidth;
2034 acx->GetWidth(text[indx], charWidth);
2035 charWidth /= 2;
2036
2037 if (PR_ABS(PRInt32(aPoint.x) - origin.x) > textWidth+charWidth) {
2038 indx++;
2039 }
2040 }
Seems like more parentheses are needed...
71 #define PR_ABS(x) ((x) < 0 ? -(x) : (x))
Ccing evaughan because of a similar definition in nsSplitterFrame.cpp.
(This is just to raise awareness since the macro is not used there --yet!)
Checked in patch supplied by rbs@maths.uq.edu.au
Status: NEW → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•