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/BackupStoreAccounts.cpp | |
parent | e88418c0145ddeba97116e49074dd8e2e9edea7a (diff) |
Replace sprintf() with snprintf(), fixes compile warnings on OpenBSD.
And compile errors on recent MinGW.
Diffstat (limited to 'lib/backupstore/BackupStoreAccounts.cpp')
-rw-r--r-- | lib/backupstore/BackupStoreAccounts.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/backupstore/BackupStoreAccounts.cpp b/lib/backupstore/BackupStoreAccounts.cpp index 22628017..7bfa029d 100644 --- a/lib/backupstore/BackupStoreAccounts.cpp +++ b/lib/backupstore/BackupStoreAccounts.cpp @@ -158,9 +158,9 @@ void BackupStoreAccounts::GetAccountRoot(int32_t ID, std::string &rRootDirOut, i std::string BackupStoreAccounts::MakeAccountRootDir(int32_t ID, int DiscSet) { char accid[64]; // big enough! - ::sprintf(accid, "%08x" DIRECTORY_SEPARATOR, ID); - return std::string(std::string(BOX_RAIDFILE_ROOT_BBSTORED - DIRECTORY_SEPARATOR) + accid); + ::snprintf(accid, sizeof(accid) - 1, "%08x" DIRECTORY_SEPARATOR, ID); + return std::string(BOX_RAIDFILE_ROOT_BBSTORED DIRECTORY_SEPARATOR) + + accid; } |