Skip to content

Commit

Permalink
Prevent warning about data loss by conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
GregoryLundberg committed May 27, 2017
1 parent 39460e2 commit 1a13b05
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/preferences/credentials.cpp
Expand Up @@ -244,7 +244,7 @@ secure_buffer build_key(const std::string& server, const std::string& login)
{
std::string sysname = get_system_username();
secure_buffer result(std::max<size_t>(server.size() + login.size() + sysname.size(), 32));
size_t i = 0;
unsigned char i = 0;
std::generate(result.begin(), result.end(), [&i]() {return 'x' ^ i++;});
std::copy(login.begin(), login.end(), result.begin());
std::copy(sysname.begin(), sysname.end(), result.begin() + login.size());
Expand Down

0 comments on commit 1a13b05

Please sign in to comment.