diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2022-03-28 16:52:29 +0100 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2022-03-28 16:52:29 +0100 |
commit | cfbd16cf7ea3335b7ac75989c4ffa63306224dfc (patch) | |
tree | 77f95ce654bb66c609cbeee4d85bc5584b0901e8 | |
parent | 231c96cf8d6d5deb051fedabdea5c6969f843e29 (diff) | |
download | netsurf-cfbd16cf7ea3335b7ac75989c4ffa63306224dfc.tar.gz netsurf-cfbd16cf7ea3335b7ac75989c4ffa63306224dfc.tar.bz2 |
Bitmap: Try to squash -Wtautological-constant-out-of-range-compare
-rw-r--r-- | desktop/bitmap.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/desktop/bitmap.c b/desktop/bitmap.c index b191043bf..acbd22e41 100644 --- a/desktop/bitmap.c +++ b/desktop/bitmap.c @@ -106,7 +106,8 @@ static const char *bitmap__layout_to_str(enum bitmap_layout layout) [BITMAP_LAYOUT_ABGR8888] = "0xAABBGGRR (native endian)", }; - if (layout >= (sizeof(str)) / sizeof(*str)) { + if ((size_t)layout >= (sizeof(str)) / sizeof(*str) || + str[layout] == NULL) { return "Unknown"; } |