Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Jian Li
medialibrary
Commits
faa80596
Commit
faa80596
authored
Jan 10, 2020
by
Hugo Beauzée-Luyssen
Browse files
utils: File: Save one useless loop iteration on EOF
parent
e229a807
Pipeline
#12598
passed with stage
in 29 minutes and 3 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/utils/File.cpp
View file @
faa80596
...
...
@@ -71,6 +71,7 @@ bool copy( const std::string& from, const std::string& to )
return
false
;
unsigned
char
buff
[
4096
];
size_t
nbRead
;
do
{
nbRead
=
fread
(
buff
,
1
,
4096
,
input
.
get
()
);
...
...
@@ -82,8 +83,7 @@ bool copy( const std::string& from, const std::string& to )
}
if
(
fwrite
(
buff
,
1
,
nbRead
,
output
.
get
()
)
==
0
)
return
false
;
}
while
(
nbRead
>
0
);
}
while
(
feof
(
input
.
get
()
)
==
0
);
return
true
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment