X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=interactive.c;h=98882ce6d772c162be24ea481daf8f847eb34d5c;hb=f484411f1a48386975f55d1273750ca3c926aa9a;hp=8c4545b476e8f792ea7bba6f88b4e83fb952e540;hpb=8181748ed84ac1e7d48ede7c00c9559263683791;p=paraslash.git diff --git a/interactive.c b/interactive.c index 8c4545b4..98882ce6 100644 --- a/interactive.c +++ b/interactive.c @@ -645,7 +645,7 @@ int i9e_select(int n, fd_set *readfds, fd_set *writefds, int i9e_extract_completions(const char *word, char **string_list, char ***result) { - char **matches = para_malloc(sizeof(char *)); + char **matches = alloc(sizeof(char *)); int match_count = 0, matches_len = 1; char **p; int len = strlen(word); @@ -656,8 +656,8 @@ int i9e_extract_completions(const char *word, char **string_list, match_count++; if (match_count >= matches_len) { matches_len *= 2; - matches = para_realloc(matches, - matches_len * sizeof(char *)); + matches = arr_realloc(matches, matches_len, + sizeof(char *)); } matches[match_count - 1] = para_strdup(*p); } @@ -693,7 +693,7 @@ char **i9e_complete_commands(const char *word, struct i9e_completer *completers) if (is_prefix(word, cmd, len)) match_count++; } - matches = para_malloc((match_count + 1) * sizeof(*matches)); + matches = alloc((match_count + 1) * sizeof(*matches)); for (i = 0, match_count = 0; (cmd = completers[i].name); i++) if (is_prefix(word, cmd, len)) matches[match_count++] = para_strdup(cmd); @@ -777,7 +777,7 @@ int i9e_print_completions(struct i9e_completer *completers) if (*p == ' ') p++; n = end - p + 1; - ci.word = para_malloc(n + 1); + ci.word = alloc(n + 1); strncpy(ci.word, p, n); ci.word[n] = '\0'; create_matches: