From: <sv...@op...> - 2024-03-15 17:39:56
|
Author: sagamusix Date: Fri Mar 15 18:39:38 2024 New Revision: 20363 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=20363 Log: [Fix] Add missing newline to key config parser error reporting. [Fix] File sizes in the instrument browser and comments tab were displayed incorrectly if a file size < 1KB ended in 0s. Modified: trunk/OpenMPT/mptrack/CommandSet.cpp trunk/OpenMPT/mptrack/Mptrack.cpp Modified: trunk/OpenMPT/mptrack/CommandSet.cpp ============================================================================== --- trunk/OpenMPT/mptrack/CommandSet.cpp Fri Mar 15 15:47:00 2024 (r20362) +++ trunk/OpenMPT/mptrack/CommandSet.cpp Fri Mar 15 18:39:38 2024 (r20363) @@ -2225,7 +2225,7 @@ keymapVersion = Version::Parse(mpt::ToUnicode(mpt::Charset::ASCII, tokens[1])); if(keymapVersion > Version::Current()) { - errText += MPT_CFORMAT("Keymap was saved with OpenMPT {}, but you are running OpenMPT {}.")(keymapVersion, Version::Current()); + errText += MPT_CFORMAT("Keymap was saved with OpenMPT {}, but you are running OpenMPT {}.\n")(keymapVersion, Version::Current()); } continue; } Modified: trunk/OpenMPT/mptrack/Mptrack.cpp ============================================================================== --- trunk/OpenMPT/mptrack/Mptrack.cpp Fri Mar 15 15:47:00 2024 (r20362) +++ trunk/OpenMPT/mptrack/Mptrack.cpp Fri Mar 15 18:39:38 2024 (r20363) @@ -2109,7 +2109,10 @@ // Variable-length formatting may decide on a whim to switch to scientific formatting, so used a fixed width and trim manually... CString s = mpt::cfmt::fix(size, 2); if(i == 0) - s.TrimRight(_T("0.")); + { + if(int pos = s.ReverseFind(_T('.')); pos >= 0) + s.Delete(pos, s.GetLength() - pos); + } return s + Unit[i]; } size /= 1024.0; |