summaryrefslogtreecommitdiff
path: root/libs/ardour/vst_plugin.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2019-11-08 01:42:06 +0100
committerRobin Gareus <robin@gareus.org>2020-04-16 16:47:13 +0200
commit2d4e125802039a824dc6d295d76fe0e558b3960e (patch)
tree5d2154f9b44558c05380d07c94f410ff76f951d5 /libs/ardour/vst_plugin.cc
parentdaf9fe25509de4360296f711ad0359b01750f70f (diff)
Prefer std::string for `print_parameter` API
Diffstat (limited to 'libs/ardour/vst_plugin.cc')
-rw-r--r--libs/ardour/vst_plugin.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/libs/ardour/vst_plugin.cc b/libs/ardour/vst_plugin.cc
index 8d8d46e090..2d5579b965 100644
--- a/libs/ardour/vst_plugin.cc
+++ b/libs/ardour/vst_plugin.cc
@@ -810,9 +810,10 @@ VSTPlugin::has_editor () const
}
bool
-VSTPlugin::print_parameter (uint32_t param, char *buf, uint32_t len) const
+VSTPlugin::print_parameter (uint32_t param, std::string& rv) const
{
- char *first_nonws;
+ char buf[64];
+ size_t len = sizeof(buf);
assert (len > VestigeMaxShortLabelLen);
memset (buf, 0, len);
@@ -824,9 +825,9 @@ VSTPlugin::print_parameter (uint32_t param, char *buf, uint32_t len) const
buf[len - 1] = '\0';
- first_nonws = buf;
+ char* first_nonws = buf;
while (*first_nonws && isspace (*first_nonws)) {
- first_nonws++;
+ ++first_nonws;
}
if (*first_nonws == '\0') {
@@ -845,6 +846,7 @@ VSTPlugin::print_parameter (uint32_t param, char *buf, uint32_t len) const
strncat (buf, lbl.c_str(), strlen (buf) - 1);
}
+ rv = std::string (buf);
return true;
}