summaryrefslogtreecommitdiff
path: root/lib/backupstore/BackupStoreAccountDatabase.cpp
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2014-12-22 23:09:31 +0000
committerChris Wilson <chris+github@qwirx.com>2014-12-22 23:09:31 +0000
commit6622bfe4eb59a2f38f7012349525ec64f0368118 (patch)
treeb116a1ec4a429ad3ecf0d8817488557f196782b1 /lib/backupstore/BackupStoreAccountDatabase.cpp
parente88418c0145ddeba97116e49074dd8e2e9edea7a (diff)
Replace sprintf() with snprintf(), fixes compile warnings on OpenBSD.
And compile errors on recent MinGW.
Diffstat (limited to 'lib/backupstore/BackupStoreAccountDatabase.cpp')
-rw-r--r--lib/backupstore/BackupStoreAccountDatabase.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/backupstore/BackupStoreAccountDatabase.cpp b/lib/backupstore/BackupStoreAccountDatabase.cpp
index 201491a3..c5f012fc 100644
--- a/lib/backupstore/BackupStoreAccountDatabase.cpp
+++ b/lib/backupstore/BackupStoreAccountDatabase.cpp
@@ -247,7 +247,8 @@ void BackupStoreAccountDatabase::Write()
{
// Write out the entry
char line[256]; // more than enough for a couple of integers in string form
- int s = ::sprintf(line, "%x:%d\n", i->second.GetID(), i->second.GetDiscSet());
+ int s = ::snprintf(line, sizeof(line), "%x:%d\n",
+ i->second.GetID(), i->second.GetDiscSet());
if(::write(file, line, s) != s)
{
THROW_EXCEPTION(CommonException, OSFileError)