summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Persch <chpe@src.gnome.org>2021-02-04 18:40:51 +0100
committerChristian Persch <chpe@src.gnome.org>2021-02-04 18:40:51 +0100
commit7619bf481882ec34ddcc1da6dfbb05891fc047ab (patch)
tree451902982152bcdd02ac69c10b7ef8576ddac8d2
parent8d4204f3afb159ac883760350c92c8f4bc4e9836 (diff)
downloadvte-7619bf481882ec34ddcc1da6dfbb05891fc047ab.tar.gz
keymap: Use int8_t for the length of the short keymap strings
... instead of ssize_t.
-rw-r--r--src/keymap.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/keymap.cc b/src/keymap.cc
index 2944ef56..a2daf796 100644
--- a/src/keymap.cc
+++ b/src/keymap.cc
@@ -18,6 +18,8 @@
#include "config.h"
+#include <cassert>
+
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
@@ -73,7 +75,7 @@ struct _vte_keymap_entry {
guint keypad_mode;
guint mod_mask;
const char normal[8];
- gssize normal_length;
+ int8_t normal_length;
};
#define X_NULL ""
@@ -756,6 +758,7 @@ _vte_keymap_map(guint keyval,
if ((modifiers & entries[i].mod_mask) == entries[i].mod_mask) {
if (entries[i].normal_length != -1) {
*normal_length = entries[i].normal_length;
+ assert(entries[i].normal_length < G_MAXINT);
*normal = (char*)g_memdup(entries[i].normal,
entries[i].normal_length);
} else {