Skip to content

Commit

Permalink
Do not use reallocarray
Browse files Browse the repository at this point in the history
Not available in musl.

Closes #20
  • Loading branch information
atx committed Dec 28, 2020
1 parent 1c20416 commit fb8cb52
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions main.c
@@ -1,6 +1,4 @@

#define _GNU_SOURCE

#include <fcntl.h>
#include <locale.h>
#include <stdbool.h>
Expand Down Expand Up @@ -140,8 +138,8 @@ unsigned int get_key_code(struct wtype *wtype, wchar_t ch)
return i;
}
}
wtype->keymap = reallocarray(
wtype->keymap, ++wtype->keymap_len, sizeof(wtype->keymap[0])
wtype->keymap = realloc(
wtype->keymap, ++wtype->keymap_len * sizeof(wtype->keymap[0])
);
wtype->keymap[wtype->keymap_len - 1] = ch;
return wtype->keymap_len - 1;
Expand Down

0 comments on commit fb8cb52

Please sign in to comment.