Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FormatError when formatting empty std::string_view #689

Closed
dermojo opened this issue Mar 21, 2018 · 2 comments
Closed

FormatError when formatting empty std::string_view #689

dermojo opened this issue Mar 21, 2018 · 2 comments

Comments

@dermojo
Copy link

dermojo commented Mar 21, 2018

When trying to format an empty string_view, fmtlib raises a FormatError because the contained pointer is nullptr. Minimal example:

#include <string_view>
#include <fmt/format.h>

int main()
{
  std::string_view x;
  fmt::print("{}\n", x);
  return 0;
}

I'd expect an empty string to be printed.

@vitaut
Copy link
Contributor

vitaut commented Mar 21, 2018

Good catch, thanks! Fixed in 8c29459.

@vitaut vitaut closed this as completed Mar 21, 2018
@dermojo
Copy link
Author

dermojo commented Mar 21, 2018

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants