fix default value for --dropmode
authorMischa POSLAWSKY <netris@shiar.org>
Sun, 4 Mar 2007 07:13:50 +0000 (08:13 +0100)
committerMischa POSLAWSKY <netris@shiar.org>
Sun, 4 Mar 2007 07:13:50 +0000 (08:13 +0100)
Caused segfault on missing value (i.e. netris -d)

game.c

diff --git a/game.c b/game.c
index a5a72ad8a45d5b9bf30c36e783eb6e6f0790a838..b9d83f4afa31e44fd1e1809f731aa4af127d2d36 100644 (file)
--- a/game.c
+++ b/game.c
@@ -147,7 +147,7 @@ void HandleOption(char tag, char *value)
                Players[0].team = atoi(value);
                break;
        case 'd':       //dropmode
-               Sets.dropmode = atoi(value);
+               Sets.dropmode = value ? atoi(value) : 1;
                break;
        case 'C':       //color
                if (value && !strcasecmp(value, "1")) Sets.color = 1;