From f80efd3954a58c38fe63d62cf73c8fcf6976d8a9 Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Fri, 9 Nov 2018 21:10:32 +0100 Subject: [PATCH] :lipstick: cleanup --- include/nlohmann/detail/input/input_adapters.hpp | 2 ++ single_include/nlohmann/json.hpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/include/nlohmann/detail/input/input_adapters.hpp b/include/nlohmann/detail/input/input_adapters.hpp index e11fb896..e9990767 100644 --- a/include/nlohmann/detail/input/input_adapters.hpp +++ b/include/nlohmann/detail/input/input_adapters.hpp @@ -82,7 +82,9 @@ class input_stream_adapter : public input_adapter_protocol auto res = sb.sbumpc(); // set eof manually, as we don't use the istream interface. if (res == EOF) + { is.clear(is.rdstate() | std::ios::eofbit); + } return res; } diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp index 806285a4..19fb6ddf 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -2131,7 +2131,9 @@ class input_stream_adapter : public input_adapter_protocol auto res = sb.sbumpc(); // set eof manually, as we don't use the istream interface. if (res == EOF) + { is.clear(is.rdstate() | std::ios::eofbit); + } return res; }