fixes from Yann E. MORIN <yann.morin.1998@anciens.enib.fr>

This commit is contained in:
Denis Vlasenko 2006-12-31 12:14:16 +00:00
parent d514ba226b
commit 806116b234
3 changed files with 8 additions and 6 deletions

View File

@ -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);

View File

@ -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");

View File

@ -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");