Skip to content

Commit

Permalink
Fix warning in test
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasHabets committed Dec 31, 2023
1 parent 2d2165c commit bd50b69
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/arping_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,8 @@ read_main(void* p)
char *cur = out->buffer;

for (;;) {
ssize_t n;
n = out->bufsize - (cur - out->buffer);
assert(n > 0);
n = read(out->reader_fd, cur, n);
const size_t to_read = out->bufsize - (size_t)(cur - out->buffer);
const ssize_t n = read(out->reader_fd, cur, to_read);
if (n > 0) {
cur += n;
}
Expand Down

0 comments on commit bd50b69

Please sign in to comment.