Changeset a7199c2 in mainline
- Timestamp:
- 2010-07-13T21:12:11Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- c0e9f3f
- Parents:
- b62d5614
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/console/kconsole.c
rb62d5614 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 } … … 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.