diff options
author | Niall Douglas (s [underscore] sourceforge {at} nedprod [dot] com) <spamtrap@nedprod.com> | 2018-08-26 22:07:10 +0300 |
---|---|---|
committer | Niall Douglas (s [underscore] sourceforge {at} nedprod [dot] com) <spamtrap@nedprod.com> | 2018-08-26 22:07:10 +0300 |
commit | 219a1deb2a2c24dfe030db9de4211516d01ecce6 (patch) | |
tree | 7fc527453087e008fcbc16113d894cb96b4661a1 /example | |
parent | 3ce0b8439d2cf850d06bc9b046ffb56648875349 (diff) |
Fix stack corruption bug in the convenience read() and write() initialiser list based overloads.
Diffstat (limited to 'example')
-rw-r--r-- | example/use_cases.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/example/use_cases.cpp b/example/use_cases.cpp index 740312d6..6fc448b6 100644 --- a/example/use_cases.cpp +++ b/example/use_cases.cpp @@ -52,7 +52,7 @@ void read_entire_file1() std::vector<llfio::byte> buffer(fh.maximum_extent().value()); // Synchronous scatter read from file - llfio::file_handle::buffers_type filled = llfio::read( + llfio::file_handle::size_type bytesread = llfio::read( fh, // handle to read from 0, // offset {{ buffer.data(), buffer.size() }} // Single scatter buffer of the vector @@ -61,7 +61,7 @@ void read_entire_file1() // In case of racy truncation of file by third party to new length, adjust buffer to // bytes actually read - buffer.resize(filled[0].size()); + buffer.resize(bytesread); //! [file_entire_file1] } |