gcc says those values are out of bounds
[apps/madtty.git] / madtty / madtty.c
index 1718b83..b876a73 100644 (file)
@@ -107,6 +107,7 @@ struct madtty_t {
     char ebuf[BUFSIZ];
     int  rlen, elen;
     madtty_handler_t handler;
+    void *data;
 };
 
 typedef struct t_row_t {
@@ -737,13 +738,15 @@ void madtty_init_vt100_graphics(void)
     vt100['f' - 0x41] = ACS_DEGREE;
     vt100['g' - 0x41] = ACS_PLMINUS;
     vt100['~' - 0x41] = ACS_BULLET;
+#if 0 /* out of bounds */
     vt100[',' - 0x41] = ACS_LARROW;
     vt100['+' - 0x41] = ACS_RARROW;
     vt100['.' - 0x41] = ACS_DARROW;
     vt100['-' - 0x41] = ACS_UARROW;
+    vt100['0' - 0x41] = ACS_BLOCK;
+#endif
     vt100['h' - 0x41] = ACS_BOARD;
     vt100['i' - 0x41] = ACS_LANTERN;
-    vt100['0' - 0x41] = ACS_BLOCK;
     /* these defaults were invented for ncurses */
     vt100['p' - 0x41] = ACS_S3;
     vt100['r' - 0x41] = ACS_S7;
@@ -1095,3 +1098,13 @@ void madtty_set_handler(madtty_t *t, madtty_handler_t handler)
 {
     t->handler = handler;
 }
+
+void madtty_set_data(madtty_t *t, void *data)
+{
+    t->data = data;
+}
+
+void *madtty_get_data(madtty_t *t)
+{
+    return t->data;
+}