Skip to content

Commit

Permalink
Merge pull request #26 from tomlogic/bugfix/null-terminate-restored-h…
Browse files Browse the repository at this point in the history
…istory-line

history: null-terminate restored history line
  • Loading branch information
Helius authored Sep 3, 2017
2 parents 91ba4f8 + 44ddc8b commit d044bf4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/microrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,7 @@ static void hist_search (microrl_t * pThis, int dir)
{
int len = hist_restore_line (&pThis->ring_hist, pThis->cmdline, dir);
if (len >= 0) {
pThis->cmdline[len] = '\0';
pThis->cursor = pThis->cmdlen = len;
terminal_reset_cursor (pThis);
terminal_print_line (pThis, 0, pThis->cursor);
Expand Down

0 comments on commit d044bf4

Please sign in to comment.