Fixed /monitors argument checks.

This commit is contained in:
Armin Novak 2017-11-29 14:13:50 +01:00
parent 2f15b806f5
commit 33271415fe
1 changed files with 2 additions and 5 deletions

View File

@ -360,11 +360,8 @@ int shadow_server_parse_command_line(rdpShadowServer* server, int argc, char** a
/* Select monitors */
long val = strtol(arg->Value, NULL, 0);
if ((val < 0) || (errno != 0))
index = 0;
if (val >= numMonitors)
index = 0;
if ((val < 0) || (errno != 0) || (val >= numMonitors))
status = COMMAND_LINE_STATUS_PRINT;
server->selectedMonitor = val;
}