Skip to content
Bitcoin Roots

v29.4-roots.4 · Commit 30: [PATCH 30/37] fix(release): close local gate findings

src/streams.cpp

Before: src/streams.cpp · After: src/streams.cpp

File metadata
index cd496ee2be48a55f87eba5e4f09d5adab2717ede..17fe6ced5fe73af3ee3b1f27276a96982c103083 100644

Download original patch · Release notes

Diff rows 1–7 of 7. Line numbers refer to the original before/after files.

+ Added− RemovedUnmarked lines are context.

Scroll the code area horizontally to read long lines. The two line-number columns refer to before and after.

src/streams.cpp CHANGED
@@ -81,6 +81,7 @@ void AutoFile::ignore(size_t nSize)
81
81
  void AutoFile::write(Span<const std::byte> src)
82
82
  {
83
83
  if (!m_file) throw std::ios_base::failure("AutoFile::write: file handle is nullptr");
84
+ if (src.empty()) return;
84
85
  if (m_xor.empty()) {
85
86
  if (std::fwrite(src.data(), 1, src.size(), m_file) != src.size()) {
86
87
  throw std::ios_base::failure("AutoFile::write: write failed");