Skip to content

Commit

Permalink
campaignd: Use utf8::lowercase() instead of a direct call to libc tol…
Browse files Browse the repository at this point in the history
…ower()

Note that the next loop in the same chunk of code already uses
utf8::lowercase() even though both strings are really of the same
nature.
  • Loading branch information
irydacea committed Jun 5, 2014
1 parent fed57b0 commit 33503f2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/campaign_server/campaign_server.cpp
Expand Up @@ -521,9 +521,10 @@ namespace {

LOG_CS << "uploading campaign '" << upload["name"] << "' from " << addr << ".\n";
config &data = upload.child("data");

const std::string& name = upload["name"];
std::string lc_name(name.size(), ' ');
std::transform(name.begin(), name.end(), lc_name.begin(), tolower);
const std::string& lc_name = utf8::lowercase(name);

config *campaign = NULL;
BOOST_FOREACH(config &c, campaigns().child_range("campaign")) {
if (utf8::lowercase(c["name"]) == lc_name) {
Expand Down

0 comments on commit 33503f2

Please sign in to comment.