#include "e_mod_utils.h"
#include "e_screen_reader_private.h"
+#include <assert.h>
+
static Eina_Bool during_event = EINA_FALSE;
static double time_between_presses = 0.01;
Eldbus_Connection *conn;
} KeyEventData;
+static char *_xstrdup(const char *str)
+{
+ char *copy = strdup(str ? str : "");
+ assert(copy != NULL);
+ return copy;
+}
+#pragma GCC poison strdup
+
static Ecore_Event_Key *
_create_key_event(KeyEventData *ked)
{
return NULL;
}
- ev->keyname = strdup(ked->info.keyname);
- ev->key = strdup(ked->info.keyname);
- ev->string = strdup(ked->info.keyname);
- ev->compose = strdup(ked->info.keyname);
+ ev->keyname = _xstrdup(ked->info.keyname);
+ ev->key = _xstrdup(ked->info.keyname);
+ ev->string = _xstrdup(ked->info.keyname);
+ ev->compose = _xstrdup(ked->info.keyname);
ev->window = e_comp->ee_win;
ev->event_window = e_comp->ee_win;
ev->root_window = e_comp->ee_win;
if (!ked)
return eldbus_message_error_new(msg, "org.freedesktop.DBus.Error.Failed", "Malloc error.");
- ked->info.keyname = strdup(kei.keyname);
+ ked->info.keyname = _xstrdup(kei.keyname);
ked->info.multiplicity = kei.multiplicity;
ked->info.hold_time = kei.hold_time;
ked->keycode = _get_keycode_from_string(kei.keyname);