From 07d94b9b4868fad26c9e8ac2ae4901849a09b8ac Mon Sep 17 00:00:00 2001 From: John Emmas Date: Sun, 4 Aug 2013 15:17:19 +0100 Subject: 'libs/ardour' - Use 'std::vector' instead of dynamically sized arrays (required to be buildable with MSVC) --- libs/ardour/region_factory.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'libs/ardour/region_factory.cc') 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 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; -- cgit v1.2.3