History

Fix parsing error in an XM-load error message

Olav Sørensen committed 6 years ago

Commit 2cf6fcb1 parent fa8fc531 file · +4 −2Browse files

Showing the changes to src/ft2_module_loader.c (1 of 1 file). Show all

Unified · Split

src/ft2_module_loader.c+4−2
@@ -1697,8 +1697,10 @@ bool doLoadMusic(bool fromExternalThread) · 1696 unmodified lines
16971697 {
16981698 fclose(f);
16991699
1700− sprintf(tmpText, "Error loading .xm: Unsupported XM version (v%1d.%1d%1d)",
1701− '0' + (((h.ver >> 8) & 0x0F) % 10), '0' + (((h.ver >> 4) & 0x0F)) % 10, '0' + ((h.ver & 0x0F)) % 10);
1700+ const int32_t major = (h.ver >> 8) & 0x0F;
1701+ const int32_t minor = h.ver & 0xFF;
1702+
1703+ sprintf(tmpText, "Error loading .xm: Unsupported file version (v%01X.%02X)", major, minor);
17021704 showMsg(0, "System message", tmpText);
17031705
17041706 moduleFailedToLoad = true;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t