]> git.pond.sub.org Git - empserver/blobdiff - src/lib/commands/set.c
Update copyright notice
[empserver] / src / lib / commands / set.c
index 62feb357460e8155c68cbf3efe5830433c6b6b4f..b599493754ae431767a3275ea36f65be6df123aa 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  Empire - A multi-player, client/server Internet based war game.
- *  Copyright (C) 1986-2008, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ *  Copyright (C) 1986-2010, Dave Pare, Jeff Bailey, Thomas Ruschak,
  *                           Ken Stevens, Steve McClure
  *
  *  This program is free software; you can redistribute it and/or modify
@@ -26,7 +26,7 @@
  *  ---
  *
  *  set.c: Place units/ships/planes/nukes up for sale.
- * 
+ *
  *  Known contributors to this file:
  *     Dave Pare, 1986
  *     Pat Loney, 1992
@@ -73,13 +73,13 @@ set(void)
     check_trade();
 
     p = getstarg(player->argp[1], "Ship, plane, land unit or nuke? ", buf);
-    if (p == 0)
+    if (!p)
        return RET_SYN;
     if ((type = ef_byname_from(p, ef_saleable)) < 0) {
        pr("You can sell only ships, planes, land units or nukes\n");
        return RET_SYN;
     }
-    if (!snxtitem(&ni, type, player->argp[2]))
+    if (!snxtitem(&ni, type, player->argp[2], NULL))
        return RET_SYN;
     while (nxtitem(&ni, &item)) {
        if (!player->owner && !player->god)
@@ -92,8 +92,8 @@ set(void)
        trade.trd_type = type;
        sprintf(prompt, "%s #%d; Price? ",
                trade_nameof(&trade, &item), ni.cur);
-       if ((p = getstarg(player->argp[3], prompt, buf)) == 0)
-           return RET_SYN;
+       if (!(p = getstarg(player->argp[3], prompt, buf)))
+           return RET_FAIL;
        if (!trade_check_item_ok(&item))
            return RET_FAIL;
        if ((price = atoi(p)) < 0)