]> gitweb.michael.orlitzky.com - iconv-quirks.git/commitdiff
main.c: replace strcpy() + strcat() with sprintf()
authorMichael Orlitzky <michael@orlitzky.com>
Tue, 7 Jul 2026 13:55:20 +0000 (09:55 -0400)
committerMichael Orlitzky <michael@orlitzky.com>
Tue, 7 Jul 2026 13:55:20 +0000 (09:55 -0400)
main.c

diff --git a/main.c b/main.c
index 6fd81e31041d385051bf068e36eb4e64f2e478b4..97f251fc2052396a904ed13ecca3ebc2d995c079 100644 (file)
--- a/main.c
+++ b/main.c
@@ -86,8 +86,7 @@ static int _my_iconv_close(iconv_t* cd) {
 static int test_iconv_open_supports_suffix(const char* suffix) {
   const char* fromcode = "ASCII";
   char* tocode = malloc(strlen(fromcode) + strlen(suffix) + 1);
-  strcpy(tocode, fromcode);
-  strcat(tocode, suffix);
+  sprintf(tocode, "%s%s", fromcode, suffix);
 
   char msg[59];
   snprintf(msg, 59, "iconv_open() supports %s suffix...", suffix);