mirror of
https://github.com/fmtlib/fmt.git
synced 2024-12-26 18:28:20 +00:00
Fix handling of unsigned char strings (#373)
This commit is contained in:
parent
195d6a5663
commit
a79c7b4e8f
@ -1277,7 +1277,9 @@ class MakeValue : public Arg {
|
|||||||
|
|
||||||
FMT_MAKE_VALUE(char *, string.value, CSTRING)
|
FMT_MAKE_VALUE(char *, string.value, CSTRING)
|
||||||
FMT_MAKE_VALUE(const 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(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_VALUE(const unsigned char *, ustring.value, CSTRING)
|
||||||
FMT_MAKE_STR_VALUE(const std::string &, STRING)
|
FMT_MAKE_STR_VALUE(const std::string &, STRING)
|
||||||
FMT_MAKE_STR_VALUE(StringRef, STRING)
|
FMT_MAKE_STR_VALUE(StringRef, STRING)
|
||||||
|
@ -1343,6 +1343,8 @@ TEST(FormatterTest, FormatUCharString) {
|
|||||||
EXPECT_EQ("test", format("{0:s}", str));
|
EXPECT_EQ("test", format("{0:s}", str));
|
||||||
const unsigned char *const_str = str;
|
const unsigned char *const_str = str;
|
||||||
EXPECT_EQ("test", format("{0:s}", const_str));
|
EXPECT_EQ("test", format("{0:s}", const_str));
|
||||||
|
unsigned char *ptr = str;
|
||||||
|
EXPECT_EQ("test", format("{0:s}", ptr));
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(FormatterTest, FormatPointer) {
|
TEST(FormatterTest, FormatPointer) {
|
||||||
|
Loading…
Reference in New Issue
Block a user