fix infinite loop

(and this, kids, is why oneliners loops are inherently suspicious)

(cherry picked from commit 727f6e3ef4533effcdc77e943f04e3c6b134cd1e)
This commit is contained in:
LWinterberg
2025-05-14 15:51:33 +02:00
committed by Avery King
parent d1f2633f47
commit 9c8db2aac4

View File

@@ -523,8 +523,11 @@ LabelStruct LabelStruct::Import(wxTextFile &file, int &index, LabelFormat format
// Labels in audacity should be only one line, so join multiple lines
// with spaces. This is not reversed on export.
while (index < (int)file.GetLineCount() &&
!file.GetLine(index).IsEmpty())
!file.GetLine(index).IsEmpty())
{
title += " " + file.GetLine(index);
index++;
}
index++; // Skip over empty line