Skip to content
Snippets Groups Projects
Unverified Commit af0e286d authored by Sam Yates's avatar Sam Yates Committed by GitHub
Browse files

Backport tinyopt pr#16 EOF comparison fix (#2242)

* Use `int` for `istream::get()` result for correct EOF checks when char
is unsigned.

Fixes #2059.
parent 562ba9eb
No related branches found
No related tags found
No related merge requests found
...@@ -892,7 +892,7 @@ struct saved_options: private std::vector<std::string> { ...@@ -892,7 +892,7 @@ struct saved_options: private std::vector<std::string> {
bool quote = false; // true => within single quotes. bool quote = false; // true => within single quotes.
bool escape = false; // true => previous character was backslash. bool escape = false; // true => previous character was backslash.
while (in) { while (in) {
char c = in.get(); int c = in.get();
if (c==EOF) break; if (c==EOF) break;
if (quote) { if (quote) {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment