Sanitize con and window rect dimensions

Make sure they're neither zero (prohibited by X11) nor overflown during
subtraction.
This commit is contained in:
Albert Safin
2020-02-19 00:48:31 +00:00
committed by Orestis Floros
parent 1f0c628cde
commit e6ca7ca06f
3 changed files with 11 additions and 0 deletions

View File

@ -65,6 +65,7 @@ bool rect_contains(Rect rect, uint32_t x, uint32_t y);
Rect rect_add(Rect a, Rect b);
Rect rect_sub(Rect a, Rect b);
bool rect_equals(Rect a, Rect b);
Rect rect_sanitize_dimensions(Rect rect);
/**
* Returns true if the name consists of only digits.