From 1bc88ed751504b1dce4ceab97cdb2c5b40eced82 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sun, 18 Nov 2018 07:00:43 -0800 Subject: Avoid a fixed-size string buffer --- Alc/alc.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'Alc') 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(); -- cgit v1.2.3