Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(42)

Unified Diff: webrtc/system_wrappers/source/file_impl.cc

Issue 1714503003: Allow passing in strings of length zero to FileWrapper::Write without closing the file. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/system_wrappers/source/file_impl.cc
diff --git a/webrtc/system_wrappers/source/file_impl.cc b/webrtc/system_wrappers/source/file_impl.cc
index 0ee0deab6c1061edb3f475d44a3ff9b7e6f7f51d..ea09661e19d442a81be2576ead48358c7c3bb5ef 100644
--- a/webrtc/system_wrappers/source/file_impl.cc
+++ b/webrtc/system_wrappers/source/file_impl.cc
@@ -243,8 +243,8 @@ bool FileWrapperImpl::Write(const void* buf, size_t length) {
}
size_t num_bytes = fwrite(buf, 1, length, id_);
- if (num_bytes > 0) {
- size_in_bytes_ += num_bytes;
+ size_in_bytes_ += num_bytes;
Henrik Grunell WebRTC 2016/02/19 15:04:38 Keep this inside the if block below. Not needed if
terelius 2016/02/19 16:50:29 By not closing the file, we can remove the entire
+ if (num_bytes == length) {
Henrik Grunell WebRTC 2016/02/19 15:04:38 The original code is unclear. Good to change this.
terelius 2016/02/19 16:05:52 I agree on 1 and 3. I'd also prefer not closing th
return true;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698