Commit b43d4789 authored by simon.hosie's avatar simon.hosie Committed by Commit bot

Use int for fgetc() result in headless_shell

Fixes compilation failure introduced by c3ac4fc0.

fgetc() returns its result as an _unsigned_ char and defines EOF as -1, and
gives the result as an int.  If char is unsigned it's impossible for EOF to
match, and this results in a compilation error.  If char is signed then
potentially valid input could match EOF.

BUG=674765
R=altimin@chromium.org, skyostil@chromium.org

Change-Id: I979a8401e8c33d8983e7d1bee96b81bc555863ec
Review-Url: https://codereview.chromium.org/2579773003
Cr-Commit-Position: refs/heads/master@{#439479}
parent a550d225
...@@ -279,7 +279,7 @@ class HeadlessShell : public HeadlessWebContents::Observer, ...@@ -279,7 +279,7 @@ class HeadlessShell : public HeadlessWebContents::Observer,
printf(">>> "); printf(">>> ");
std::stringstream expression; std::stringstream expression;
while (true) { while (true) {
char c = fgetc(stdin); int c = fgetc(stdin);
if (c == EOF || c == '\n') { if (c == EOF || c == '\n') {
break; break;
} }
......
Markdown is supported
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