diff options
author | Chris Wilson <chris+github@qwirx.com> | 2014-12-22 23:09:31 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2014-12-22 23:09:31 +0000 |
commit | 6622bfe4eb59a2f38f7012349525ec64f0368118 (patch) | |
tree | b116a1ec4a429ad3ecf0d8817488557f196782b1 /lib/backupstore/BackupStoreCheck2.cpp | |
parent | e88418c0145ddeba97116e49074dd8e2e9edea7a (diff) |
Replace sprintf() with snprintf(), fixes compile warnings on OpenBSD.
And compile errors on recent MinGW.
Diffstat (limited to 'lib/backupstore/BackupStoreCheck2.cpp')
-rw-r--r-- | lib/backupstore/BackupStoreCheck2.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/backupstore/BackupStoreCheck2.cpp b/lib/backupstore/BackupStoreCheck2.cpp index e5728fa9..13831a09 100644 --- a/lib/backupstore/BackupStoreCheck2.cpp +++ b/lib/backupstore/BackupStoreCheck2.cpp @@ -356,7 +356,7 @@ void BackupStoreDirectoryFixer::InsertObject(int64_t ObjectID, bool IsDirectory, { // Directory -- simply generate a name for it. char name[32]; - ::sprintf(name, "dir%08x", lostDirNameSerial); + ::snprintf(name, sizeof(name), "dir%08x", lostDirNameSerial); objectStoreFilename.SetAsClearFilename(name); } else @@ -447,7 +447,7 @@ int64_t BackupStoreCheck::GetLostAndFoundDirID() while(true) { char name[32]; - ::sprintf(name, "lost+found%d", n++); + ::snprintf(name, sizeof(name), "lost+found%d", n++); lostAndFound.SetAsClearFilename(name); if(!dir.NameInUse(lostAndFound)) { |