resolve comments from hardening
This commit is contained in:
parent
ce06229499
commit
2a91988975
@ -132,10 +132,10 @@ static RECTANGLE_16 *region16_extents_noconst(REGION16 *region)
|
||||
|
||||
BOOL rectangle_is_empty(const RECTANGLE_16 *rect)
|
||||
{
|
||||
/* A rectangle with width <= 0 or height <= 0 should be regarded
|
||||
/* A rectangle with width = 0 or height = 0 should be regarded
|
||||
* as empty.
|
||||
*/
|
||||
return ((rect->left >= rect->right) || (rect->top >= rect->bottom)) ? TRUE : FALSE;
|
||||
return ((rect->left == rect->right) || (rect->top == rect->bottom)) ? TRUE : FALSE;
|
||||
}
|
||||
|
||||
BOOL region16_is_empty(const REGION16 *region)
|
||||
|
@ -668,11 +668,10 @@ static int test_empty_rectangle() {
|
||||
int retCode = -1;
|
||||
int i;
|
||||
|
||||
RECTANGLE_16 emptyRectangles[4] = {
|
||||
RECTANGLE_16 emptyRectangles[3] = {
|
||||
{ 0, 0, 0, 0},
|
||||
{ 10, 10, 10, 11},
|
||||
{ 10, 10, 11, 10},
|
||||
{ 100, 100, 0, 0}
|
||||
{ 10, 10, 11, 10}
|
||||
};
|
||||
|
||||
RECTANGLE_16 firstRect = {
|
||||
@ -689,7 +688,7 @@ static int test_empty_rectangle() {
|
||||
region16_init(&intersection);
|
||||
|
||||
/* Check for empty rectangles */
|
||||
for (i = 0; i < 4; i++)
|
||||
for (i = 0; i < 3; i++)
|
||||
{
|
||||
if (!rectangle_is_empty(&emptyRectangles[i]))
|
||||
goto out;
|
||||
|
Loading…
Reference in New Issue
Block a user