Skip to content

Commit

Permalink
fix: sonar
Browse files Browse the repository at this point in the history
  • Loading branch information
dudantas committed Nov 12, 2024
1 parent cb227aa commit 444c519
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/database/database.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 444c519

Please sign in to comment.