diff options
author | Thomas Habets <thomas@habets.se> | 2015-04-22 20:48:38 +0100 |
---|---|---|
committer | Thomas Habets <thomas@habets.se> | 2015-04-22 20:48:38 +0100 |
commit | e16870c0458a89c313a8672f96bc5974b079d92b (patch) | |
tree | 22e97b4cb45a0e9eb0345e14970dc9c3d6c0705c /src/arping_test.c | |
parent | df12f226dd56ef1a679fcac8fa97bfc34ccedbf9 (diff) | |
download | arping-e16870c0458a89c313a8672f96bc5974b079d92b.tar.gz |
Silence all warnings in unit tests on clang.
Diffstat (limited to 'src/arping_test.c')
-rw-r--r-- | src/arping_test.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/arping_test.c b/src/arping_test.c index fa2f877..ac26274 100644 --- a/src/arping_test.c +++ b/src/arping_test.c @@ -16,10 +16,13 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#define _GNU_SOURCE #include<assert.h> #include<errno.h> #include<fcntl.h> #include<inttypes.h> +#include<pthread.h> +#include<stdio.h> #include<stdlib.h> #include<check.h> @@ -77,7 +80,7 @@ read_main(void* p) struct captured_output* out = p; char *cur = out->buffer; - while (1) { + for (;;) { ssize_t n; n = out->bufsize - (cur - out->buffer); assert(n > 0); @@ -86,7 +89,7 @@ read_main(void* p) cur += n; } if (n == 0) { - break; + return NULL; } } } @@ -406,7 +409,7 @@ MYTEST(pingip_interesting_packet) stop_capture(sout); char* emsg = NULL; - asprintf(&emsg, "Captured: <%s> (%d), want <%s> %d\n", sout->buffer, strlen(sout->buffer), correct0, strlen(correct0)); + asprintf(&emsg, "Captured: <%s> (%zd), want <%s> %zd\n", sout->buffer, strlen(sout->buffer), correct0, strlen(correct0)); fail_unless(!strncmp(sout->buffer, correct0, strlen(correct0)), emsg); uncapture(sout); free(emsg); |