shithub: choc

Download patch

ref: 1ef81eb5f7c336972fe56f15285f389cafdc96f5
parent: f4eb88dd2322db7831563ad55f8b6c45516906f9
author: Simon Howard <fraggle@gmail.com>
date: Tue Dec 14 15:55:30 EST 2010

Check that an address is provided to the -query command line option
(thanks Sander van Dijk).

Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 2221

--- a/NEWS
+++ b/NEWS
@@ -79,6 +79,8 @@
        exp(x)).
      * The controller player in a netgame is the first player to join,
        instead of just being someone who gets lucky.
+     * Check that an address is provided to the -query command line
+       option (thanks Sander van Dijk).
 
     libtextscreen:
      * The font used for the textscreen library can be forced by
--- a/src/d_main.c
+++ b/src/d_main.c
@@ -868,7 +868,7 @@
 
     p = M_CheckParm("-query");
 
-    if (p > 0)
+    if (p && p < myargc-1)
     {
         NET_QueryAddress(myargv[p+1]);
         exit(0);