Skip to content
Snippets Groups Projects
Commit 4ddf62f3 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Don't allow terminal columns and rows to be set to -1

Range check return value of console.getnum(), as is done in useredit.cpp.

The user hitting ^C at eithe of the terminal columns or rows prompts would
set that value -1.
parent 2e35069b
No related branches found
No related tags found
No related merge requests found
...@@ -327,13 +327,20 @@ while(bbs.online && !js.terminated) { ...@@ -327,13 +327,20 @@ while(bbs.online && !js.terminated) {
break; break;
} }
case 'L': case 'L':
{
console.putmsg(bbs.text(bbs.text.HowManyColumns)); console.putmsg(bbs.text(bbs.text.HowManyColumns));
thisuser.screen_columns = console.getnum(999,0); var val = console.getnum(999,0);
if (val < 0)
break;
thisuser.screen_columns = val;
console.putmsg(bbs.text(bbs.text.HowManyRows)); console.putmsg(bbs.text(bbs.text.HowManyRows));
thisuser.screen_rows = console.getnum(999,0); val = console.getnum(999,0);
if (val < 0)
break;
if (user.number === thisuser.number) if (user.number === thisuser.number)
console.getdimensions(); console.getdimensions();
break; break;
}
case 'M': case 'M':
console.putmsg(bbs.text(bbs.text.EnterNetMailAddress)); console.putmsg(bbs.text(bbs.text.EnterNetMailAddress));
var email = console.getstr(thisuser.netmail, LEN_NETMAIL var email = console.getstr(thisuser.netmail, LEN_NETMAIL
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment