specify truncate flag explicitely

This commit is contained in:
Robin Müller 2023-06-18 19:04:36 +02:00
parent 0a977ea688
commit f2947bc78e
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814

View File

@ -165,7 +165,8 @@ ReturnValue_t HostFilesystem::truncateFile(FilesystemParams params) {
if (not filesystem::exists(path, e)) { if (not filesystem::exists(path, e)) {
return FILE_DOES_NOT_EXIST; return FILE_DOES_NOT_EXIST;
} }
ofstream of(path); // Specify truncaion flug explicitely.
ofstream of(path, std::ios::out | std::ios::trunc);
return returnvalue::OK; return returnvalue::OK;
} }