]> git.pond.sub.org Git - empserver/blobdiff - src/lib/commands/look.c
Fix trailing whitespace
[empserver] / src / lib / commands / look.c
index f064b8d0782cc063df9a61d41904307c0fdafa62..45e316fc8900d71fa22ad5f72aedf582b3cbb7b5 100644 (file)
@@ -26,7 +26,7 @@
  *  ---
  *
  *  look.c: Lookout from a ship or land unit
- * 
+ *
  *  Known contributors to this file:
  *     Ron Koenderink, 2006-2007
  */
@@ -70,14 +70,14 @@ do_look(short type)
     if (CANT_HAPPEN(type != EF_LAND && type != EF_SHIP))
        type = EF_SHIP;
 
-    if (!snxtitem(&ni, type, player->argp[1]))
+    if (!snxtitem(&ni, type, player->argp[1], NULL))
        return RET_SYN;
-    if ((bitmap = malloc((WORLD_X * WORLD_Y) / 8)) == 0) {
+    bitmap = calloc(WORLD_SZ() / 8, 1);
+    if (!bitmap) {
        logerror("malloc failed in do_look\n");
        pr("Memory error.  Tell the deity.\n");
        return RET_FAIL;
     }
-    memset(bitmap, 0, (WORLD_X * WORLD_Y) / 8);
     while (nxtitem(&ni, &unit)) {
        if (!player->owner)
            continue;