From 6622bfe4eb59a2f38f7012349525ec64f0368118 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Mon, 22 Dec 2014 23:09:31 +0000 Subject: Replace sprintf() with snprintf(), fixes compile warnings on OpenBSD. And compile errors on recent MinGW. --- lib/backupstore/BackupStoreAccountDatabase.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/backupstore/BackupStoreAccountDatabase.cpp') 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) -- cgit v1.2.3