diff options
| author | 2022-12-27 13:35:14 +0000 | |
|---|---|---|
| committer | 2022-12-27 13:37:38 +0000 | |
| commit | 193408e3b4fff079fc869836bc56868c71879899 (patch) | |
| tree | cdf790e39788441833f0ee73ef479643af53400f /src/inspstring.cpp | |
| parent | Merge branch 'insp3' into master. (diff) | |
Replace the unused `padding` argument of Percent::Encode with `upper`.
Diffstat (limited to 'src/inspstring.cpp')
| -rw-r--r-- | src/inspstring.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/inspstring.cpp b/src/inspstring.cpp index 7ac9974ee..f24393188 100644 --- a/src/inspstring.cpp +++ b/src/inspstring.cpp @@ -26,7 +26,7 @@ #include "inspircd.h" -std::string Percent::Encode(const void* data, size_t length, const char* table, char padding) +std::string Percent::Encode(const void* data, size_t length, const char* table, bool upper) { if (!table) table = Percent::TABLE; @@ -35,6 +35,7 @@ std::string Percent::Encode(const void* data, size_t length, const char* table, std::string buffer; buffer.reserve(length * 3); + const char* hex_table = upper ? Hex::TABLE_UPPER : Hex::TABLE_LOWER; const unsigned char* udata = reinterpret_cast<const unsigned char*>(data); for (size_t idx = 0; idx < length; ++idx) { @@ -48,8 +49,8 @@ std::string Percent::Encode(const void* data, size_t length, const char* table, { // The character is not on the safe list; percent encode it. buffer.push_back('%'); - buffer.push_back(Hex::TABLE_UPPER[chr >> 4]); - buffer.push_back(Hex::TABLE_UPPER[chr & 15]); + buffer.push_back(hex_table[chr >> 4]); + buffer.push_back(hex_table[chr & 15]); } } |
