]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - play.c
Merge topic branch t/overflow into master
[paraslash.git] / play.c
diff --git a/play.c b/play.c
index 66383ebe0b8cb6a742801cfd33cd08155ee857b1..b60557244f5755b620c10240c60a2b73e28983e1 100644 (file)
--- a/play.c
+++ b/play.c
@@ -288,7 +288,7 @@ static int shuffle_compare(__a_unused const void *a, __a_unused const void *b)
 static void init_shuffle_map(void)
 {
        unsigned n, num_inputs = lls_num_inputs(play_lpr);
-       shuffle_map = para_malloc(num_inputs * sizeof(unsigned));
+       shuffle_map = arr_alloc(num_inputs, sizeof(unsigned));
        for (n = 0; n < num_inputs; n++)
                shuffle_map[n] = n;
        if (!OPT_GIVEN(RANDOMIZE))
@@ -591,7 +591,7 @@ static char *get_user_key_map_seq(int key)
        if (!p)
                return NULL;
        len = p - kma;
-       result = para_malloc(len + 1);
+       result = alloc(len + 1);
        memcpy(result, kma, len);
        result[len] = '\0';
        return result;
@@ -611,7 +611,7 @@ static char *get_key_map_seq_safe(int key)
 
        if (len == 1 && isprint(*seq))
                return seq;
-       sseq = para_malloc(2 + 2 * len + 1);
+       sseq = alloc(2 + 2 * len + 1);
        sseq[0] = '0';
        sseq[1] = 'x';
        for (n = 0; n < len; n++) {
@@ -651,7 +651,7 @@ static char **get_mapped_keyseqs(void)
        char **result;
        int i;
 
-       result = para_malloc((NUM_MAPPED_KEYS + 1) * sizeof(char *));
+       result = arr_alloc(NUM_MAPPED_KEYS + 1, sizeof(char *));
        FOR_EACH_MAPPED_KEY(i) {
                char *seq = get_key_map_seq(i);
                result[i] = seq;
@@ -1260,7 +1260,7 @@ int main(int argc, char *argv[])
        session_open();
        num_inputs = lls_num_inputs(play_lpr);
        init_shuffle_map();
-       pt->invalid = para_calloc(sizeof(*pt->invalid) * num_inputs);
+       pt->invalid = arr_zalloc(num_inputs, sizeof(*pt->invalid));
        pt->rq = CRT_FILE_CHANGE;
        pt->playing = true;
        pt->task = task_register(&(struct task_info){