COMPMID-417: Fix JSON printer

Change-Id: I6cc3ff1535baa7abcee0972e0f1755ea6306e15b
Reviewed-on: http://mpd-gerrit.cambridge.arm.com/83514
Reviewed-by: Pablo Tello <pablo.tello@arm.com>
Tested-by: Kaizen <jeremy.johnson+kaizengerrit@arm.com>
diff --git a/framework/printers/JSONPrinter.cpp b/framework/printers/JSONPrinter.cpp
index 10cc911..099734e 100644
--- a/framework/printers/JSONPrinter.cpp
+++ b/framework/printers/JSONPrinter.cpp
@@ -105,7 +105,7 @@
     std::stringstream error_log;
     error_log.str(error.what());
 
-    for(std::string line; !std::getline(error_log, line).eof();)
+    for(std::string line; !std::getline(error_log, line).fail();)
     {
         print_separator(_first_error);