diff options
author | John Mark Bell <jmb@netsurf-browser.org> | 2009-11-22 14:27:56 +0000 |
---|---|---|
committer | John Mark Bell <jmb@netsurf-browser.org> | 2009-11-22 14:27:56 +0000 |
commit | 2427ebea77e798206eabdb9dd194b8b8a5296825 (patch) | |
tree | 8e297d003f33bf6e9280c9d6c4745bad606150f2 /framebuffer/fbtk.c | |
parent | 3f4d79e576b67f0880584845bd64e8dd8823abc1 (diff) | |
download | netsurf-2427ebea77e798206eabdb9dd194b8b8a5296825.tar.gz netsurf-2427ebea77e798206eabdb9dd194b8b8a5296825.tar.bz2 |
Fix array bounds check
svn path=/trunk/netsurf/; revision=9697
Diffstat (limited to 'framebuffer/fbtk.c')
-rw-r--r-- | framebuffer/fbtk.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/framebuffer/fbtk.c b/framebuffer/fbtk.c index d212fb4d5..f980d6f5d 100644 --- a/framebuffer/fbtk.c +++ b/framebuffer/fbtk.c @@ -29,6 +29,7 @@ #include <libnsfb_event.h> #include <libnsfb_cursor.h> +#include "utils/utils.h" #include "utils/log.h" #include "css/css.h" #include "desktop/browser.h" @@ -1351,10 +1352,10 @@ int fbtk_keycode_to_ucs4(int code, uint8_t mods) int ucs4 = -1; if (mods) { - if ((code >= 0) && (code < (int) sizeof(sh_keymap))) + if ((code >= 0) && (code < (int) NOF_ELEMENTS(sh_keymap))) ucs4 = sh_keymap[code]; } else { - if ((code >= 0) && (code < (int) sizeof(keymap))) + if ((code >= 0) && (code < (int) NOF_ELEMENTS(keymap))) ucs4 = keymap[code]; } return ucs4; |