projects
/
xscreensaver
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ftp://ftp.krokus.ru/pub/OpenBSD/distfiles/xscreensaver-4.06.tar.gz
[xscreensaver]
/
hacks
/
sonar.c
diff --git
a/hacks/sonar.c
b/hacks/sonar.c
index 3a3e6ce883e243eae5a35a9a231b356412cd8c97..77255743adeb05e0afb982c0780cf1213a026e79 100644
(file)
--- a/
hacks/sonar.c
+++ b/
hacks/sonar.c
@@
-38,7
+38,7
@@
* software for any purpose. It is provided "as is" without express or
* implied warranty.
*
* software for any purpose. It is provided "as is" without express or
* implied warranty.
*
- * $Revision: 1.2
1
$
+ * $Revision: 1.2
2
$
*
* Version 1.0 April 27, 1998.
* - Initial version
*
* Version 1.0 April 27, 1998.
* - Initial version
@@
-523,7
+523,7
@@
static void
print_host (FILE *out, unsigned long ip, const char *name)
{
char ips[50];
print_host (FILE *out, unsigned long ip, const char *name)
{
char ips[50];
- sprintf (ips, "%
d.%d.%d.%d
",
+ sprintf (ips, "%
lu.%lu.%lu.%lu
",
(ip) & 255,
(ip >> 8) & 255,
(ip >> 16) & 255,
(ip) & 255,
(ip >> 8) & 255,
(ip >> 16) & 255,
@@
-787,9
+787,9
@@
subnetHostsList(int base, int subnet_width)
if (subnet_width < 24)
{
fprintf (stderr,
if (subnet_width < 24)
{
fprintf (stderr,
-
"%s: pinging %
u hosts is a bad idea; please use a subnet mask of 24 bits\n"
+
"%s: pinging %l
u hosts is a bad idea; please use a subnet mask of 24 bits\n"
" or more (255 hosts max.)\n",
" or more (255 hosts max.)\n",
- progname, (1L << (32 - subnet_width)) - 1);
+ progname, (
unsigned long) (
1L << (32 - subnet_width)) - 1);
exit (1);
}
else if (subnet_width > 30)
exit (1);
}
else if (subnet_width > 30)
@@
-860,9
+860,15
@@
subnetHostsList(int base, int subnet_width)
fprintf(stderr, "%s: subnet: %s (%d.%d.%d.%d & %d.%d.%d.%d / %d)\n",
progname,
address,
fprintf(stderr, "%s: subnet: %s (%d.%d.%d.%d & %d.%d.%d.%d / %d)\n",
progname,
address,
- (base>>24)&255, (base>>16)&255, (base>>8)&255, base&mask&255,
- (mask>>24)&255, (mask>>16)&255, (mask>>8)&255, mask&255,
- subnet_width);
+ (int) (base>>24)&255,
+ (int) (base>>16)&255,
+ (int) (base>> 8)&255,
+ (int) (base&mask&255),
+ (int) (mask>>24)&255,
+ (int) (mask>>16)&255,
+ (int) (mask>> 8)&255,
+ (int) (mask&255),
+ (int) subnet_width);
p = address + strlen(address) + 1;
sprintf(p, "%d", i);
p = address + strlen(address) + 1;
sprintf(p, "%d", i);
@@
-1840,6
+1846,7
@@
parse_mode (Bool ping_works_p)
{
char *source = get_string_resource ("ping", "Ping");
char *token, *end;
{
char *source = get_string_resource ("ping", "Ping");
char *token, *end;
+ char dummy;
ping_target *hostlist = 0;
ping_target *hostlist = 0;
@@
-1909,7
+1916,7
@@
parse_mode (Bool ping_works_p)
{
new = subnetHostsList(0, 24);
}
{
new = subnetHostsList(0, 24);
}
- else if (1 == sscanf (token, "subnet/%d %c", &m))
+ else if (1 == sscanf (token, "subnet/%d %c", &m
, &dummy
))
{
new = subnetHostsList(0, m);
}
{
new = subnetHostsList(0, m);
}