diff --git a/src/tools/Tools.cpp b/src/tools/Tools.cpp
index 8a3d1cf4fdf0a1f95e1aa0e676a682debc84aa73..b29b5ab60f2640101881c599cb63d31f01c27cc0 100644
--- a/src/tools/Tools.cpp
+++ b/src/tools/Tools.cpp
@@ -197,6 +197,7 @@ bool Tools::getline(FILE* fp,string & line){
     if(ss>0) if(buffer[ss-1]=='\n') break;
   };
   if(line.length()>0) if(*(line.end()-1)=='\n') line.erase(line.end()-1);
+  if(line.length()>0) if(*(line.end()-1)=='\r') line.erase(line.end()-1);
   return ret;
 }