Skip to content

Issues with fmt::format_to_n() #1056

@Devenec

Description

@Devenec

After running the following code

char buffer[32];
const fmt::format_to_n_result<char*> result = fmt::format_to_n(buffer, sizeof(buffer), "{}", 'A');

result.size is 0 when it should be 1.

Also, when changing the format string from "{}" to "{} " (adding a single space), result.size is 1 when it should be 2, and the contents of buffer is " " (a single space) following garbage as it's not null-terminated.

The {fmt} code running is from commit a977577 and built with Visual Studio 2017 15.9.5 v141 toolset.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions