apps/system/vi: Add missing vi_release before exit.

If VI exit without vi_release, that broken console.

Signed-off-by: Leo Chung <gewalalb@gmail.com>
This commit is contained in:
Leo Chung 2024-10-24 17:20:54 +08:00 committed by Alan C. Assis
parent c0e04b0251
commit c7a905ec0c

View file

@ -559,6 +559,7 @@ static void vi_write(FAR struct vi_s *vi, FAR const char *buffer,
{
fprintf(stderr, "ERROR: write to stdout failed: %d\n",
errcode);
vi_release(vi);
exit(EXIT_FAILURE);
}
}
@ -635,6 +636,7 @@ static int vi_getch(FAR struct vi_s *vi)
{
fprintf(stderr, "ERROR: read from stdin failed: %d\n",
errcode);
vi_release(vi);
exit(EXIT_FAILURE);
}
}