mirror of
https://github.com/troglobit/finit.git
synced 2026-10-30 12:50:34 +00:00
Size 0 in copyfile copies entire file (semantics of <0 reserved)
Also updated documentation Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
This commit is contained in:
1 parent
dbb31994a0
commit
d17c3160bd
2 files changed
+7
-5
No files matched your search
@@ -71,8 +71,8 @@ void copyfile(char *src, char *dst, int size)
|
||||
if ((s = open(src, O_RDONLY)) >= 0) {
|
||||
if ((d = open(dst, O_WRONLY | O_CREAT, 0644)) >= 0) {
|
||||
|
||||
/* Size <= 0 means copy entire file */
|
||||
if (size <= 0) {
|
||||
/* Size == 0 means copy entire file */
|
||||
if (size == 0) {
|
||||
do {
|
||||
if ((n = read(s, buffer, BUF_SIZE)) > 0)
|
||||
write(d, buffer, n);
|
||||
|
||||
Reference in new issue
Block a user