From 88d5a2b9d5425b7a32febc2431315d15597d07b5 Mon Sep 17 00:00:00 2001 From: degomme Date: Wed, 1 Jun 2016 01:32:50 +0200 Subject: [PATCH] .. and of strcat, replaced by strncat --- src/surf/surf_interface.cpp | 4 ++-- tools/sg_unit_extractor.pl | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/surf/surf_interface.cpp b/src/surf/surf_interface.cpp index 952cf79ed1..c48de1d6db 100644 --- a/src/surf/surf_interface.cpp +++ b/src/surf/surf_interface.cpp @@ -229,8 +229,8 @@ int find_model_description(s_surf_model_description_t * table, name_list = xbt_strdup(table[0].name); for (i = 1; table[i].name; i++) { name_list = (char *) xbt_realloc(name_list, strlen(name_list) + strlen(table[i].name) + 3); - strcat(name_list, ", "); - strcat(name_list, table[i].name); + strncat(name_list, ", ", 2); + strncat(name_list, table[i].name, strlen(table[i].name)); } xbt_die("Model '%s' is invalid! Valid models are: %s.", name, name_list); return -1; diff --git a/tools/sg_unit_extractor.pl b/tools/sg_unit_extractor.pl index 2dee83a059..4c0de32889 100755 --- a/tools/sg_unit_extractor.pl +++ b/tools/sg_unit_extractor.pl @@ -151,8 +151,8 @@ int main(int argc, char *argv[]) { if (selection[0] == '\\0') { strcpy(selection, p); } else { - strcat(selection, \",\"); - strcat(selection, p); + strncat(selection, \",\",1); + strncat(selection, p, 1024); } } else if (!strcmp(argv[i], \"--verbose\")) { verbosity++; -- 2.20.1