Changeset 4518991 in mainline
- Timestamp:
- 2021-08-10T14:20:22Z (3 years ago)
- Children:
- 87eba56
- Parents:
- 3d36920e
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/bdsh/input.c
r3d36920e r4518991 91 91 *data = odict_get_instance(alias_link, alias_t, odict); 92 92 /* check if the alias already has been resolved once */ 93 if (! find_alias_hup(*data, alias_hups)) {93 if (! find_alias_hup(*data, alias_hups)) { 94 94 alias_hup_t *hup = (alias_hup_t *)calloc(1, sizeof(alias_hup_t)); 95 95 if (hup == NULL) { … … 111 111 errno_t rc = EOK; 112 112 const size_t input_length = str_size(*line) - str_size(cmd[0]) + str_size(data->value) + 1; 113 *line = (char *)malloc(input_length);114 if ( *line == NULL) {113 char *newline = (char *)malloc(input_length); 114 if (newline == NULL) { 115 115 cli_error(CL_EFAIL, "%s: cannot allocate input structure\n", PACKAGE_NAME); 116 116 rc = ENOMEM; … … 118 118 } 119 119 120 *line[0] = '\0';120 newline[0] = '\0'; 121 121 122 122 unsigned int cmd_replace_index = tokens_start; … … 130 130 } 131 131 132 str_append( *line, input_length, data->value);132 str_append(newline, input_length, data->value); 133 133 } else { 134 str_append(*line, input_length, tokens[i].text); 135 } 136 } 137 134 str_append(newline, input_length, tokens[i].text); 135 } 136 } 137 138 *line = newline; 138 139 exit: 139 140 return rc;
Note:
See TracChangeset
for help on using the changeset viewer.