Skip to content

Commit

Permalink
fix codacy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
braindigitalis committed Oct 5, 2023
1 parent fa3c3ad commit aa34d14
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/dpp/utility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,8 @@ uptime::uptime(time_t diff) : uptime() {
}

std::string uptime::to_string() const {
char print_buffer[64];
if (hours == 0 && days == 0) {
char print_buffer[64];
snprintf(print_buffer, 64, "%02d:%02d", mins, secs);
return print_buffer;
} else {
Expand Down Expand Up @@ -518,10 +518,10 @@ std::vector<std::string> tokenize(std::string const &in, const char* sep) {
std::string bot_invite_url(const snowflake bot_id, const uint64_t permissions, const std::vector<std::string>& scopes) {
std::string scope;
if (scopes.size()) {
for (auto& s : scopes) {
for (const auto& s : scopes) {
scope += s + "+";
}
scope = scope.substr(0, scope.length() - 1);
scope.pop_back();
}
return "https://discord.com/oauth2/authorize?client_id=" + std::to_string(bot_id) + "&permissions=" + std::to_string(permissions) + "&scope=" + scope;
}
Expand Down Expand Up @@ -568,7 +568,7 @@ std::string url_encode(const std::string &value) {
}
}
*data = 0;
return escaped.data();
return escaped;
}

std::string slashcommand_mention(snowflake command_id, const std::string &command_name, const std::string &subcommand) {
Expand Down

0 comments on commit aa34d14

Please sign in to comment.