From 444c519ab56ff3e5c51e8310f893bfc5a590e6f9 Mon Sep 17 00:00:00 2001 From: Eduardo Dantas Date: Tue, 12 Nov 2024 18:25:01 -0300 Subject: [PATCH] fix: sonar --- src/database/database.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/database/database.cpp b/src/database/database.cpp index 6a81f948841..0781c3b2d74 100644 --- a/src/database/database.cpp +++ b/src/database/database.cpp @@ -123,9 +123,9 @@ void Database::createDatabaseBackup(bool compress) const { return; } - char buffer[8192]; - while (backupFile.read(buffer, sizeof(buffer)) || backupFile.gcount() > 0) { - gzwrite(gzFile, buffer, backupFile.gcount()); + std::string buffer(8192, '\0'); + while (backupFile.read(&buffer[0], buffer.size()) || backupFile.gcount() > 0) { + gzwrite(gzFile, buffer.data(), backupFile.gcount()); } backupFile.close();