Fixed /monitors argument checks.
authorArmin Novak <armin.novak@thincast.com>
Wed, 29 Nov 2017 13:13:50 +0000 (14:13 +0100)
committerArmin Novak <armin.novak@thincast.com>
Wed, 29 Nov 2017 13:13:50 +0000 (14:13 +0100)
server/shadow/shadow_server.c

index 899bd30..0f6872d 100644 (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;
                }