♻️ change behavior for null FILE*
This commit is contained in:
parent
5a97913e93
commit
d07c454127
@ -63,13 +63,9 @@ class file_input_adapter
|
|||||||
~file_input_adapter() = default;
|
~file_input_adapter() = default;
|
||||||
|
|
||||||
std::char_traits<char>::int_type get_character() noexcept
|
std::char_traits<char>::int_type get_character() noexcept
|
||||||
{
|
|
||||||
if (JSON_HEDLEY_LIKELY(m_file != nullptr))
|
|
||||||
{
|
{
|
||||||
return std::fgetc(m_file);
|
return std::fgetc(m_file);
|
||||||
}
|
}
|
||||||
return std::char_traits<char>::eof(); // LCOV_EXCL_LINE
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/// the file pointer to read from
|
/// the file pointer to read from
|
||||||
|
|||||||
@ -5950,13 +5950,9 @@ class file_input_adapter
|
|||||||
~file_input_adapter() = default;
|
~file_input_adapter() = default;
|
||||||
|
|
||||||
std::char_traits<char>::int_type get_character() noexcept
|
std::char_traits<char>::int_type get_character() noexcept
|
||||||
{
|
|
||||||
if (JSON_HEDLEY_LIKELY(m_file != nullptr))
|
|
||||||
{
|
{
|
||||||
return std::fgetc(m_file);
|
return std::fgetc(m_file);
|
||||||
}
|
}
|
||||||
return std::char_traits<char>::eof(); // LCOV_EXCL_LINE
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/// the file pointer to read from
|
/// the file pointer to read from
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user