diff options
author | David Robillard <d@drobilla.net> | 2020-12-14 16:52:12 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2020-12-14 16:52:12 +0100 |
commit | 9b6f5f83f84d2db3924999fa61233fc7396b1fbb (patch) | |
tree | 7a5484816cc7fc671cfe6c48afcb1c0a22da583c | |
parent | 2d76306c2aeb447e29b4cc93ab67ebe35b1d9d72 (diff) | |
download | jalv-9b6f5f83f84d2db3924999fa61233fc7396b1fbb.tar.gz jalv-9b6f5f83f84d2db3924999fa61233fc7396b1fbb.tar.bz2 jalv-9b6f5f83f84d2db3924999fa61233fc7396b1fbb.zip |
Avoid use of strcat()
-rw-r--r-- | .clang-tidy | 1 | ||||
-rw-r--r-- | src/jack.c | 3 |
2 files changed, 1 insertions, 3 deletions
diff --git a/.clang-tidy b/.clang-tidy index 9405211..3f9683c 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -14,7 +14,6 @@ Checks: > -cert-err34-c, -clang-analyzer-core.CallAndMessage, -clang-analyzer-optin.cplusplus.VirtualCall, - -clang-analyzer-security.insecureAPI.strcpy, -cppcoreguidelines-avoid-non-const-global-variables, -cppcoreguidelines-macro-usage, -cppcoreguidelines-owning-memory, @@ -510,8 +510,7 @@ jack_initialize(jack_client_t* const client, const char* const load_init) /* Build full command line with "program" name for building argv */ const size_t cmd_len = strlen("jalv ") + args_len; char* const cmd = (char*)calloc(cmd_len + 1, 1); - strcat(cmd, "jalv "); - strcat(cmd, load_init); + snprintf(cmd, cmd_len + 1, "jalv %s", load_init); /* Build argv */ int argc = 0; |