Changes in kernel/generic/src/console/kconsole.c [7a0359b:a7199c2] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/console/kconsole.c
r7a0359b ra7199c2 210 210 link_t *pos = NULL; 211 211 const char *hint; 212 char output[MAX_CMDLINE];212 char *output = malloc(MAX_CMDLINE, 0); 213 213 214 214 output[0] = 0; … … 235 235 str_cpy(input, size, output); 236 236 237 free(output); 237 238 return found; 238 239 } … … 245 246 wchar_t *current = history[history_pos]; 246 247 current[0] = 0; 248 char *tmp = malloc(STR_BOUNDS(MAX_CMDLINE), 0); 247 249 248 250 while (true) { … … 289 291 beg++; 290 292 291 char tmp[STR_BOUNDS(MAX_CMDLINE)];292 293 wstr_to_str(tmp, position - beg + 1, current + beg); 293 294 … … 415 416 } 416 417 418 free(tmp); 417 419 return current; 418 420 } … … 630 632 cmd->argv[i].vartype = ARG_TYPE_STRING; 631 633 } else { 632 printf("Wrong syn xtax.\n");634 printf("Wrong syntax.\n"); 633 635 error = true; 634 636 } … … 688 690 printf("Type \"exit\" to leave the console.\n"); 689 691 692 char *cmdline = malloc(STR_BOUNDS(MAX_CMDLINE), 0); 690 693 while (true) { 691 694 wchar_t *tmp = clever_readline((char *) prompt, stdin); … … 694 697 continue; 695 698 696 char cmdline[STR_BOUNDS(MAX_CMDLINE)];697 699 wstr_to_str(cmdline, STR_BOUNDS(MAX_CMDLINE), tmp); 698 700 … … 706 708 (void) cmd_info->func(cmd_info->argv); 707 709 } 710 free(cmdline); 708 711 } 709 712
Note:
See TracChangeset
for help on using the changeset viewer.