Use safe wrappers wherever possible

This commit is contained in:
shdown
2015-08-03 12:50:50 +03:00
parent bc52fae15c
commit c85d16faa4
14 changed files with 31 additions and 52 deletions

View File

@ -393,9 +393,9 @@ static Binding *binding_copy(Binding *bind) {
Binding *ret = smalloc(sizeof(Binding));
*ret = *bind;
if (bind->symbol != NULL)
ret->symbol = strdup(bind->symbol);
ret->symbol = sstrdup(bind->symbol);
if (bind->command != NULL)
ret->command = strdup(bind->command);
ret->command = sstrdup(bind->command);
if (bind->translated_to != NULL) {
ret->translated_to = smalloc(sizeof(xcb_keycode_t) * bind->number_keycodes);
memcpy(ret->translated_to, bind->translated_to, sizeof(xcb_keycode_t) * bind->number_keycodes);