From b2b6ab8eff317f6a507ab23897ea6cd5c718d99a Mon Sep 17 00:00:00 2001 From: Yaniv Kaul Date: Thu, 2 Aug 2018 16:02:33 +0300 Subject: All: remove memset() before sprintf() It's not needed. There's a good chance the compiler is smart enough to remove it anyway, but it can't hurt - I hope. Compile-tested only! Change-Id: Id7c054e146ba630227affa591007803f3046416b updates: bz#1193929 Signed-off-by: Yaniv Kaul --- cli/src/cli-cmd-system.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'cli/src/cli-cmd-system.c') diff --git a/cli/src/cli-cmd-system.c b/cli/src/cli-cmd-system.c index 3b1d967b650..c41594bfa59 100644 --- a/cli/src/cli-cmd-system.c +++ b/cli/src/cli-cmd-system.c @@ -469,7 +469,6 @@ cli_cmd_sys_exec_cbk (struct cli_state *state, struct cli_cmd_word *word, tmp = strtok_r (NULL, " ", &saveptr); if (tmp) { in_cmd_args_count++; - memset (cmd_arg_name, '\0', sizeof(cmd_arg_name)); snprintf (cmd_arg_name, sizeof(cmd_arg_name), "cmd_arg_%d", in_cmd_args_count); ret = dict_set_str (dict, cmd_arg_name, tmp); @@ -491,7 +490,6 @@ cli_cmd_sys_exec_cbk (struct cli_state *state, struct cli_cmd_word *word, for (i=1; i <= cmd_args_count; i++) { in_cmd_args_count++; - memset (cmd_arg_name, '\0', sizeof(cmd_arg_name)); snprintf (cmd_arg_name, sizeof(cmd_arg_name), "cmd_arg_%d", in_cmd_args_count); ret = dict_set_str (dict, cmd_arg_name, -- cgit