gearmulator

Emulation of classic VA synths of the late 90s/2000s that are based on Motorola 56300 family DSPs
Log | Files | Refs | Submodules | README | LICENSE

commit 267cb3cc9f4b1e531527a285707f8247c13f1e6d
parent f4e7798f9a128b1bc58ec90567858f9712992827
Author: dsp56300 <dsp56300@users.noreply.github.com>
Date:   Tue,  5 Nov 2024 17:00:43 +0100

check if file has been written completely or report error

Diffstat:
Msource/juceUiLib/editor.cpp | 8+++++---
1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/source/juceUiLib/editor.cpp b/source/juceUiLib/editor.cpp @@ -96,12 +96,14 @@ namespace genericUI if(!hFile) { - errors << "Failed to create file " << folder << _name << std::endl; + errors << "Failed to create file " << folder << _name << '\n'; } else { - fwrite(data, dataSize, 1, hFile); - fclose(hFile); + const auto writtenCount = fwrite(data, 1, dataSize, hFile); + (void)fclose(hFile); + if(writtenCount != dataSize) + errors << "Failed to write " << dataSize << " bytes to " << folder << _name << '\n'; } };