diff --git a/coreutils/cp.c b/coreutils/cp.c index 428eaee..c863630 100644 --- a/coreutils/cp.c +++ b/coreutils/cp.c @@ -23,7 +23,7 @@ char *make_path(const char *src, const char *dst) { int write_buffer(int ifd, int ofd) { off_t len = lseek(ifd, 0, SEEK_END); - if (len <= 0) + if (len < 0) return 1; if (ftruncate(ofd, len) < 0) @@ -143,7 +143,7 @@ int main(const int argc, const char **argv) { if (new_path == NULL) return 1; - if (copy(argv[i], new_path)) + if (cptree(argv[i], new_path)) ret = 1; free(new_path);