diff --git a/plugins/cdvdGigaherz/src/FileStream.cpp b/plugins/cdvdGigaherz/src/FileStream.cpp index f8a21ca906..ddf3b196aa 100644 --- a/plugins/cdvdGigaherz/src/FileStream.cpp +++ b/plugins/cdvdGigaherz/src/FileStream.cpp @@ -98,20 +98,17 @@ int FileStream::read(byte* b, int len) string FileStream::readLine() { string s; - char c; s.clear(); - do { - if(eof()) + while (!eof()) + { + char c = read(); + + if ((c == '\n') || (c == '\r') || (c == '\0')) break; - c = read(); - - if((c=='\n')||(c=='\r')||(c==0)) - break; - - s.append(1,c); - } while(true); + s.append(1, c); + } return s; } @@ -119,20 +116,17 @@ string FileStream::readLine() wstring FileStream::readLineW() { wstring s; - wchar_t c; s.clear(); - do { - if(eof()) + while (!eof()) + { + wchar_t c = read(); + + if ((c == L'\n') || (c == L'\r') || (c == L'\0')) break; - c = read(); - - if((c==L'\n')||(c==L'\r')||(c==0)) - break; - - s.append(1,c); - } while(true); + s.append(1, c); + } return s; }