mirror of
https://github.com/fmtlib/fmt.git
synced 2025-12-09 18:26:57 +08:00
Fix handling of unsigned char strings (#373)
(cherry picked from commit a79c7b4e8fb2c1b512b38a6da22c69fe5680fd19)
This commit is contained in:
parent
5047091ad8
commit
f4a417f8fb
@ -1245,7 +1245,9 @@ class MakeValue : public Arg {
|
||||
|
||||
FMT_MAKE_VALUE(char *, string.value, CSTRING)
|
||||
FMT_MAKE_VALUE(const char *, string.value, CSTRING)
|
||||
FMT_MAKE_VALUE(signed char *, sstring.value, CSTRING)
|
||||
FMT_MAKE_VALUE(const signed char *, sstring.value, CSTRING)
|
||||
FMT_MAKE_VALUE(unsigned char *, ustring.value, CSTRING)
|
||||
FMT_MAKE_VALUE(const unsigned char *, ustring.value, CSTRING)
|
||||
FMT_MAKE_STR_VALUE(const std::string &, STRING)
|
||||
FMT_MAKE_STR_VALUE(StringRef, STRING)
|
||||
|
||||
@ -1343,6 +1343,8 @@ TEST(FormatterTest, FormatUCharString) {
|
||||
EXPECT_EQ("test", format("{0:s}", str));
|
||||
const unsigned char *const_str = str;
|
||||
EXPECT_EQ("test", format("{0:s}", const_str));
|
||||
unsigned char *ptr = str;
|
||||
EXPECT_EQ("test", format("{0:s}", ptr));
|
||||
}
|
||||
|
||||
TEST(FormatterTest, FormatPointer) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user