fixes from Yann E. MORIN <yann.morin.1998@anciens.enib.fr>
authorDenis Vlasenko <vda.linux@googlemail.com>
Sun, 31 Dec 2006 12:14:16 +0000 (12:14 -0000)
committerDenis Vlasenko <vda.linux@googlemail.com>
Sun, 31 Dec 2006 12:14:16 +0000 (12:14 -0000)
miscutils/less.c
networking/ping.c
networking/ping6.c

index 807a5bf4760bb826499d050cd7232f29f0d5ad16..916213082c905bb2ec9a608ed5ff916e2f4245ae 100644 (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);
index 658c015180dde346f32e4fa3f515db695f92ecb2..acbb8ec6f2d37a817b28fdae8cea459f3f271ed9 100644 (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");
index 9f0509e661b973cd768a592e5df86fd99e1a655c..778dcd4f574a4d532091e8c949a7d4d618429035 100644 (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");