fixes from Yann E. MORIN <yann.morin.1998@anciens.enib.fr>
This commit is contained in:
parent
d514ba226b
commit
806116b234
@ -415,7 +415,7 @@ static void print_ascii(const char *str)
|
||||
n = strcspn(str, controls);
|
||||
if (n) {
|
||||
if (!str[n]) break;
|
||||
printf("%.*s", n, str);
|
||||
printf("%.*s", (int) n, str);
|
||||
str += n;
|
||||
}
|
||||
n = strspn(str, controls);
|
||||
|
@ -117,8 +117,9 @@ static void ping(const char *host)
|
||||
struct sockaddr_in from;
|
||||
socklen_t fromlen = sizeof(from);
|
||||
|
||||
if ((c = recvfrom(pingsock, packet, sizeof(packet), 0,
|
||||
(struct sockaddr *) &from, &fromlen)) < 0) {
|
||||
c = recvfrom(pingsock, packet, sizeof(packet), 0,
|
||||
(struct sockaddr *) &from, &fromlen);
|
||||
if (c < 0) {
|
||||
if (errno == EINTR)
|
||||
continue;
|
||||
bb_perror_msg("recvfrom");
|
||||
|
@ -104,10 +104,11 @@ static void ping(const char *host)
|
||||
/* listen for replies */
|
||||
while (1) {
|
||||
struct sockaddr_in6 from;
|
||||
size_t fromlen = sizeof(from);
|
||||
socklen_t fromlen = sizeof(from);
|
||||
|
||||
if ((c = recvfrom(pingsock, packet, sizeof(packet), 0,
|
||||
(struct sockaddr *) &from, &fromlen)) < 0) {
|
||||
c = recvfrom(pingsock, packet, sizeof(packet), 0,
|
||||
(struct sockaddr *) &from, &fromlen);
|
||||
if (c < 0) {
|
||||
if (errno == EINTR)
|
||||
continue;
|
||||
bb_perror_msg("recvfrom");
|
||||
|
Loading…
Reference in New Issue
Block a user