Skip to content

Commit

Permalink
empty song title fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
bengarrett committed Aug 11, 2024
1 parent 68cd4d2 commit 6e1856f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions internal/magicnumber/synthesismusic.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,9 @@ func MusicMTM(p []byte) string {
}
s := "MultiTrack song"
song := string(bytes.Trim(p[offset:headerLen+offset], "\x00"))
song = strings.TrimSpace(song)
if song != "" {
s += fmt.Sprintf(", %q", strings.TrimSpace(song))
s += fmt.Sprintf(", %q", song)
}
return s
}
Expand All @@ -81,8 +82,9 @@ func MusicIT(p []byte) string {
}
s := "Impulse Tracker song"
song := string(bytes.Trim(p[offset:headerLen+offset], "\x00"))
song = strings.TrimSpace(song)
if song != "" {
s += fmt.Sprintf(", %q", strings.TrimSpace(song))
s += fmt.Sprintf(", %q", song)
}
return s
}
Expand All @@ -103,8 +105,9 @@ func MusicXM(p []byte) string {
}
s := "extended module tracked music"
song := string(bytes.Trim(p[offset:headerLen+offset], "\x00"))
song = strings.TrimSpace(song)
if song != "" {
s += fmt.Sprintf(", %q", strings.TrimSpace(song))
s += fmt.Sprintf(", %q", song)
}
return s
}
Expand Down

0 comments on commit 6e1856f

Please sign in to comment.