From 8810c36c6e8830bf846c69d8a4f28359538e5eca Mon Sep 17 00:00:00 2001 From: Marijn Kruisselbrink Date: Fri, 17 Feb 2023 12:06:52 -0800 Subject: [PATCH] Fix audio source names when importing files with > 2 and <= 26 channels. This code presumably intended to name sources "foo%a", "foo%b" etc, but since it was incorrectly appending the character as an integer sources instead ended up being named "foo%97", "foo%98" etc. Also changes the branching logic to use this branch upto 26 channels, rather than just upto 25 channels, as that seems to have been the intention. --- libs/ardour/session.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index 5fc575f892..6d06a97909 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -4908,9 +4908,9 @@ Session::format_audio_source_name (const string& legalized_base, uint32_t nchan, sstr << "%R"; } } else if (nchan > 2) { - if (nchan < 26) { + if (nchan <= 26) { sstr << '%'; - sstr << 'a' + chan; + sstr << static_cast('a' + chan); } else { /* XXX what? more than 26 channels! */ sstr << '%';