aboutsummaryrefslogtreecommitdiffstats
path: root/Alc
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2018-11-18 07:00:43 -0800
committerChris Robinson <[email protected]>2018-11-18 07:00:43 -0800
commit1bc88ed751504b1dce4ceab97cdb2c5b40eced82 (patch)
tree3fa2bdcf43f37aacf31f76934696958c0cd3df5b /Alc
parent5bbddff2f33dfc1a25b150202f8c49c4661e8115 (diff)
Avoid a fixed-size string buffer
Diffstat (limited to 'Alc')
-rw-r--r--Alc/alc.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/Alc/alc.cpp b/Alc/alc.cpp
index 15f191ff..3a4905b1 100644
--- a/Alc/alc.cpp
+++ b/Alc/alc.cpp
@@ -980,14 +980,15 @@ static void alc_initconfig(void)
TRACE("Initializing library v%s-%s %s\n", ALSOFT_VERSION,
ALSOFT_GIT_COMMIT_HASH, ALSOFT_GIT_BRANCH);
{
- char buf[1024] = "";
- int len = 0;
-
+ std::string names;
if(BackendListSize > 0)
- len += snprintf(buf, sizeof(buf), "%s", BackendList[0].name);
+ names += BackendList[0].name;
for(i = 1;i < BackendListSize;i++)
- len += snprintf(buf+len, sizeof(buf)-len, ", %s", BackendList[i].name);
- TRACE("Supported backends: %s\n", buf);
+ {
+ names += ", ";
+ names += BackendList[i].name;
+ }
+ TRACE("Supported backends: %s\n", names.c_str());
}
ReadALConfig();