diff options
| author | Markus Uhlin <markus@nifty-networks.net> | 2025-10-17 21:58:29 +0200 |
|---|---|---|
| committer | Markus Uhlin <markus@nifty-networks.net> | 2025-10-17 21:58:29 +0200 |
| commit | 8f0b065735a0c96fd8d2497aa69ae839c6685da6 (patch) | |
| tree | 94a60f50aab992573f53a718bc0592904dfe0a53 | |
| parent | caf799c956945481977632b9203398e21f95a67f (diff) | |
Test only for a positive return value
| -rw-r--r-- | FICS/copyfile.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/FICS/copyfile.c b/FICS/copyfile.c index 73b3195..408a0f4 100644 --- a/FICS/copyfile.c +++ b/FICS/copyfile.c @@ -75,7 +75,7 @@ fics_copyfile(const char *p1, const char *p2, const bool post_checks) return false; } - while ((ret[0] = read(fd[0], tmp, sizeof tmp)) != -1 && ret[0] != 0) { + while ((ret[0] = read(fd[0], tmp, sizeof tmp)) > 0) { total_read += ret[0]; if ((ret[1] = write(fd[1], tmp, ret[0])) != ret[0]) { |
