Skip to content
Snippets Groups Projects
Commit 3b19380f 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 a917325f
No related branches found
No related tags found
1 merge request!455Update branch with changes from master
......@@ -327,13 +327,20 @@ while(bbs.online && !js.terminated) {
break;
}
case 'L':
{
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));
thisuser.screen_rows = console.getnum(999,0);
val = console.getnum(999,0);
if (val < 0)
break;
if (user.number === thisuser.number)
console.getdimensions();
break;
}
case 'M':
console.putmsg(bbs.text(bbs.text.EnterNetMailAddress));
var email = console.getstr(thisuser.netmail, LEN_NETMAIL
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment