@@ -38,8 +38,7 @@ public:
3838 fprintf (stderr, " Error: Cannot read \" %s\" . %s\n " , inputPath.filename ().string ().c_str (), strerror (errno));
3939 return ;
4040 }
41- std::unique_ptr<char []> stdiBuf (new char [STDIO_IOFBF_SIZE ]);
42- setvbuf (inputFile.get (), stdiBuf.get (), _IOFBF, STDIO_IOFBF_SIZE );
41+ setvbuf (inputFile.get (), nullptr , _IOFBF, STDIO_IOFBF_SIZE );
4342
4443 if (fread (buffer + FILENUM_OFFSET , 1 , XA_DATA_SIZE , inputFile.get ()) != XA_DATA_SIZE )
4544 {
@@ -111,12 +110,10 @@ public:
111110 if (!std::filesystem::exists (outputDir))
112111 std::filesystem::create_directories (outputDir);
113112
114- std::unique_ptr<char []> stdiBuf (new char [STDIO_IOFBF_SIZE ]);
115- std::unique_ptr<char []> stdoBuf (new char [STDIO_IOFBF_SIZE ]);
116-
117113 std::unique_ptr<FILE , decltype (&fclose)> inputFile (fopen (inputPath.string ().c_str (), " rb" ), &fclose);
118- setvbuf (inputFile.get (), stdiBuf. get () , _IOFBF, STDIO_IOFBF_SIZE );
114+ setvbuf (inputFile.get (), nullptr , _IOFBF, STDIO_IOFBF_SIZE );
119115
116+ std::unique_ptr<char []> stdoBuf (new char [STDIO_IOFBF_SIZE ]);
120117 for (const FileInfo &entry : entries)
121118 {
122119 std::filesystem::path fileName = std::filesystem::u8path (entry.fileName );
@@ -205,7 +202,8 @@ private:
205202 int chunksRead = 0 ;
206203 bool eof = buffer[SUBMODE_OFFSET ] & 0x80 ; // 0x80 = EOF_MASK
207204 bool silent = isSilent ();
208- do {
205+ for (;;)
206+ {
209207 // entry.endSec = currentSector;
210208 processedSectors[currentSector++] = true ;
211209 // if (currentSector >= 42185) //
@@ -274,7 +272,7 @@ private:
274272 if (silent)
275273 silent = isSilent ();
276274 }
277- } while ( true );
275+ }
278276
279277 END :
280278 const int nullSectors = entry.nullTrailing / entry.sectorChunk * entry.sectorStride + entry.nullTrailing ;
0 commit comments