Skip to content

Commit

Permalink
ensure that window size information is always initialized
Browse files Browse the repository at this point in the history
Fixes a divide-by-zero crash reported by sthen@. To reproduce:

  printf 'show\nshow run\n' > /tmp/nsh.script
  nsh -i /tmp/nsh.script
  
ok chris
  • Loading branch information
stspdotname committed Jan 24, 2024
1 parent 5a6c908 commit 41d076f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions main.c
Expand Up @@ -255,6 +255,8 @@ main(int argc, char *argv[])
*/
priv = 1;

setwinsize(0);

create_db();

/*
Expand All @@ -277,6 +279,8 @@ main(int argc, char *argv[])
*/
priv = 1;

setwinsize(0);

create_db();

cmdrc(rc);
Expand Down

0 comments on commit 41d076f

Please sign in to comment.