You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
char *foobar = "lorem ipsum";
format("dolor sit {1} amet", foobar);
Expected result: "dolor sit lorem ipsum amet"
Actual result: "dolor sit dolor sit amet amet"
When passing in a char*-type variable to format's varargs list, need to cast the variable to std::string or convert it to a std::string. Not doing so results in fmt variable (first arg) being read a second time as one of the vararg variables.
Not a major issue but this small wart can take people by surprise - if this is wontfix, may I recommend adding a comment in the source?
The text was updated successfully, but these errors were encountered:
Expected result:
"dolor sit lorem ipsum amet"
Actual result:
"dolor sit dolor sit amet amet"
When passing in a
char*
-type variable toformat
's varargs list, need to cast the variable tostd::string
or convert it to astd::string
. Not doing so results infmt
variable (first arg) being read a second time as one of the vararg variables.Not a major issue but this small wart can take people by surprise - if this is wontfix, may I recommend adding a comment in the source?
The text was updated successfully, but these errors were encountered: