diff --git a/userspace/cp/main.cpp b/userspace/cp/main.cpp index 2e0c263c4a..bfd2a8a8f6 100644 --- a/userspace/cp/main.cpp +++ b/userspace/cp/main.cpp @@ -69,7 +69,7 @@ bool copy_file(const BAN::String& source, BAN::String destination) perror("write"); ret = false; } - if (nwrite == 0) + if (nwrite <= 0) break; written += nwrite; }