resolve comments from hardening

This commit is contained in:
zihao.jiang 2015-03-21 00:04:30 +08:00
parent ce06229499
commit 2a91988975
2 changed files with 5 additions and 6 deletions

View File

@ -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)

View File

@ -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;