diff options
Diffstat (limited to 'src/internal.c')
-rw-r--r-- | src/internal.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/internal.c b/src/internal.c index 3799e97..31345f3 100644 --- a/src/internal.c +++ b/src/internal.c @@ -19,6 +19,12 @@ puglIsValidPosition(const int x, const int y) } bool +puglIsValidSize(const unsigned width, const unsigned height) +{ + return width && height && width <= INT16_MAX && height <= INT16_MAX; +} + +bool puglIsValidArea(const PuglArea size) { return size.width && size.height; @@ -80,8 +86,7 @@ puglStoreSizeHint(PuglView* const view, const unsigned width, const unsigned height) { - if (width > INT16_MAX || height > INT16_MAX || - (unsigned)hint >= PUGL_NUM_SIZE_HINTS) { + if (!puglIsValidSize(width, height)) { return PUGL_BAD_PARAMETER; } |