mirror of
https://github.com/s3fs-fuse/s3fs-fuse.git
synced 2025-01-10 16:20:59 +00:00
Merge pull request #1436 from ggtakec/fix_code
Fixed signature error due to case of hex string
This commit is contained in:
commit
be308e9d11
@ -163,7 +163,7 @@ std::string urlEncode(const std::string &s)
|
|||||||
result += c;
|
result += c;
|
||||||
}else{
|
}else{
|
||||||
result += "%";
|
result += "%";
|
||||||
result += s3fs_hex(&c, 1);
|
result += s3fs_hex(&c, 1, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
@ -193,7 +193,7 @@ std::string urlEncode2(const std::string &s)
|
|||||||
result += c;
|
result += c;
|
||||||
}else{
|
}else{
|
||||||
result += "%";
|
result += "%";
|
||||||
result += s3fs_hex(&c, 1);
|
result += s3fs_hex(&c, 1, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
@ -373,9 +373,12 @@ bool convert_unixtime_from_option_arg(const char* argv, time_t& unixtime)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string s3fs_hex(const unsigned char* input, size_t length)
|
std::string s3fs_hex(const unsigned char* input, size_t length, bool lower)
|
||||||
{
|
{
|
||||||
static const char hexAlphabet[] = "0123456789abcdef";
|
static const char hexLower[] = "0123456789abcdef";
|
||||||
|
static const char hexUpper[] = "0123456789ABCDEF";
|
||||||
|
|
||||||
|
const char* hexAlphabet = (lower ? hexLower : hexUpper);
|
||||||
std::string hex;
|
std::string hex;
|
||||||
for(size_t pos = 0; pos < length; ++pos){
|
for(size_t pos = 0; pos < length; ++pos){
|
||||||
hex += hexAlphabet[input[pos] / 16];
|
hex += hexAlphabet[input[pos] / 16];
|
||||||
|
@ -92,7 +92,7 @@ bool get_keyword_value(std::string& target, const char* keyword, std::string& va
|
|||||||
//
|
//
|
||||||
// For binary string
|
// For binary string
|
||||||
//
|
//
|
||||||
std::string s3fs_hex(const unsigned char* input, size_t length);
|
std::string s3fs_hex(const unsigned char* input, size_t length, bool lower = true);
|
||||||
char* s3fs_base64(const unsigned char* input, size_t length);
|
char* s3fs_base64(const unsigned char* input, size_t length);
|
||||||
unsigned char* s3fs_decode64(const char* input, size_t* plength);
|
unsigned char* s3fs_decode64(const char* input, size_t* plength);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user