Skip to content

Commit

Permalink
Fix success return error code
Browse files Browse the repository at this point in the history
  • Loading branch information
mborland committed Dec 7, 2023
1 parent 7df51ba commit 5b5850f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/boost/charconv/to_chars.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -616,12 +616,12 @@ to_chars_result to_chars_printf_impl(char* first, char* last, T value, chars_for
format[pos] = '\n';
const auto rv = print_val(first, last - first, format, value);

if (rv == -1)
if (rv <= 0)

Check warning on line 619 in include/boost/charconv/to_chars.hpp

View check run for this annotation

Codecov / codecov/patch

include/boost/charconv/to_chars.hpp#L619

Added line #L619 was not covered by tests
{
return {last, static_cast<std::errc>(errno)};
}

return {first + rv, static_cast<std::errc>(errno)};
return {first + rv, std::errc()};

Check warning on line 624 in include/boost/charconv/to_chars.hpp

View check run for this annotation

Codecov / codecov/patch

include/boost/charconv/to_chars.hpp#L624

Added line #L624 was not covered by tests
}

} // Namespace detail
Expand Down

0 comments on commit 5b5850f

Please sign in to comment.