Check the return value of getline

Otherwise, `gcc` warns, which causes the build to fail
This commit is contained in:
Paul Woolcock
2015-01-02 09:32:29 -05:00
parent 50be5971a4
commit 25b31a206a
+2 -2
View File
@@ -81,10 +81,10 @@ static int runRepl(WrenVM* vm)
char* line = NULL;
size_t size = 0;
getline(&line, &size, stdin);
ssize_t num_read = getline(&line, &size, stdin);
// If stdin was closed (usually meaning the user entered Ctrl-D), exit.
if (feof(stdin))
if (feof(stdin) || num_read == -1)
{
printf("\n");
return 0;