]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
fix rcon crash
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 27 Sep 2012 10:25:09 +0000 (10:25 +0000)
committerRudolf Polzer <divverent@alientrap.org>
Sat, 29 Sep 2012 07:55:09 +0000 (09:55 +0200)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11853 d7cf8633-e32d-0410-b094-e92efae38249
::stable-branch::merge=5919f7641ef28e7e58b89da6cee142f0418cdbc5

host_cmd.c

index 4d2b93b6eb76617231bf405b14151e017e68a1fa..841c4df2d8ed135a7595efa1b730dd3b23987d08 100644 (file)
@@ -2463,6 +2463,12 @@ static void Host_PQRcon_f (void)
        lhnetsocket_t *mysocket;
        char peer_address[64];
 
+       if (Cmd_Argc() == 1)
+       {
+               Con_Printf("%s: Usage: %s command\n", Cmd_Argv(0), Cmd_Argv(0));
+               return;
+       }
+
        if (!rcon_password.string || !rcon_password.string[0] || rcon_secure.integer > 0)
        {
                Con_Printf ("You must set rcon_password before issuing an pqrcon command, and rcon_secure must be 0.\n");
@@ -2524,6 +2530,12 @@ static void Host_Rcon_f (void) // credit: taken from QuakeWorld
        lhnetsocket_t *mysocket;
        char vabuf[1024];
 
+       if (Cmd_Argc() == 1)
+       {
+               Con_Printf("%s: Usage: %s command\n", Cmd_Argv(0), Cmd_Argv(0));
+               return;
+       }
+
        if (!rcon_password.string || !rcon_password.string[0])
        {
                Con_Printf ("You must set rcon_password before issuing an rcon command.\n");