http://packetstorm.tacticalflex.com/UNIX/admin/xscreensaver-3.27.tar.gz
[xscreensaver] / hacks / sonar.c
index 0608ac5bf668e94c0f92ccd4add89a4aab495cea..53f56aa925c2ae992f4a302bd7aae868b43b4f64 100644 (file)
@@ -28,7 +28,8 @@
  *   - plot the process table, by process size, cpu usage, or total time;
  *   - plot the logged on users by idle time or cpu usage.
  *
- * Copyright (C) 1998 by Stephen Martin (smartin@vanderfleet-martin.net).
+ * Copyright (C) 1998, 2001
+ *  by Stephen Martin (smartin@vanderfleet-martin.net).
  * Permission to use, copy, modify, distribute, and sell this software and its
  * documentation for any purpose is hereby granted without fee, provided that
  * the above copyright notice appear in all copies and that both that
@@ -37,7 +38,7 @@
  * software for any purpose.  It is provided "as is" without express or 
  * implied warranty.
  *
- * $Revision: 1.16 $
+ * $Revision: 1.18 $
  *
  * Version 1.0 April 27, 1998.
  * - Initial version
@@ -215,13 +216,14 @@ void *sensor_info;                        /* Information about the sensor */
  * A list of targets to ping.
  */
 
-#ifdef HAVE_PING
 typedef struct ping_target {
     char *name;                        /* The name of the target */
     struct sockaddr address;   /* The address of the target */
     struct ping_target *next;  /* The next one in the list */
 } ping_target;
 
+
+#ifdef HAVE_PING
 /*
  * Ping Information.
  *
@@ -698,7 +700,7 @@ subnetHostsList(int base, int subnet_width)
         fprintf (stderr,
     "%s: pinging %u hosts is a bad idea; please use a subnet mask of 24 bits\n"
                  "       or more (255 hosts max.)\n",
-                 progname, 1L << (32 - subnet_width));
+                 progname, (1L << (32 - subnet_width)) - 1);
         exit (1);
       }
     else if (subnet_width > 30)
@@ -1661,6 +1663,7 @@ Sonar(sonar_info *si, Bogie *bl)
            else
                prev->next = bp->next;
            freeBogie(bp);
+            bp = prev;
        } else
            prev = bp;
     }