diff options
author | John Emmas <johne53@tiscali.co.uk> | 2013-08-04 15:17:19 +0100 |
---|---|---|
committer | John Emmas <johne53@tiscali.co.uk> | 2013-08-04 15:17:19 +0100 |
commit | 07d94b9b4868fad26c9e8ac2ae4901849a09b8ac (patch) | |
tree | df4278a908166a81d65383b1171197172ca47131 /libs/ardour/region_factory.cc | |
parent | fa59391f6a8b8bffbf07fc567d726c40424fe7f7 (diff) |
'libs/ardour' - Use 'std::vector' instead of dynamically sized arrays (required to be buildable with MSVC)
Diffstat (limited to 'libs/ardour/region_factory.cc')
-rw-r--r-- | libs/ardour/region_factory.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libs/ardour/region_factory.cc b/libs/ardour/region_factory.cc index 3e81524750..44f8c34ddd 100644 --- a/libs/ardour/region_factory.cc +++ b/libs/ardour/region_factory.cc @@ -564,7 +564,7 @@ RegionFactory::new_region_name (string old) uint32_t number; string::size_type len = old.length() + 64; string remainder; - char buf[len]; + std::vector<char> buf(len); if ((last_period = old.find_last_of ('.')) == string::npos) { @@ -603,8 +603,8 @@ RegionFactory::new_region_name (string old) number++; - snprintf (buf, len, "%s%" PRIu32 "%s", old.substr (0, last_period + 1).c_str(), number, remainder.c_str()); - sbuf = buf; + snprintf (&buf[0], len, "%s%" PRIu32 "%s", old.substr (0, last_period + 1).c_str(), number, remainder.c_str()); + sbuf = &buf[0]; if (region_name_map.find (sbuf) == region_name_map.end ()) { break; @@ -612,7 +612,7 @@ RegionFactory::new_region_name (string old) } if (number != (UINT_MAX-1)) { - return buf; + return &buf[0]; } error << string_compose (_("cannot create new name for region \"%1\""), old) << endmsg; |