summaryrefslogtreecommitdiff
path: root/lib/backupstore/BackupStoreFileDiff.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/BackupStoreFileDiff.cpp
parente88418c0145ddeba97116e49074dd8e2e9edea7a (diff)
Replace sprintf() with snprintf(), fixes compile warnings on OpenBSD.
And compile errors on recent MinGW.
Diffstat (limited to 'lib/backupstore/BackupStoreFileDiff.cpp')
-rw-r--r--lib/backupstore/BackupStoreFileDiff.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/backupstore/BackupStoreFileDiff.cpp b/lib/backupstore/BackupStoreFileDiff.cpp
index fd186e7c..1d83d854 100644
--- a/lib/backupstore/BackupStoreFileDiff.cpp
+++ b/lib/backupstore/BackupStoreFileDiff.cpp
@@ -1042,9 +1042,11 @@ static void GenerateRecipe(BackupStoreFileEncodeStream::Recipe &rRecipe, BlocksA
{
char b[64];
#ifdef WIN32
- sprintf(b, "%8I64d", (int64_t)(rRecipe[e].mpStartBlock - pIndex));
+ snprintf(b, sizeof(b), "%8I64d", (int64_t)
+ (rRecipe[e].mpStartBlock - pIndex));
#else
- sprintf(b, "%8lld", (int64_t)(rRecipe[e].mpStartBlock - pIndex));
+ snprintf(b, sizeof(b), "%8lld", (int64_t)
+ (rRecipe[e].mpStartBlock - pIndex));
#endif
BOX_TRACE(std::setw(8) <<
rRecipe[e].mSpaceBefore <<