From 2c0a3bc9796397a4cd32f7d4f581361fa72087b5 Mon Sep 17 00:00:00 2001 From: Sultan Alsawaf Date: Sat, 23 Mar 2019 18:52:54 -0700 Subject: [PATCH] touchscreen: sec_ts: Fix horrible strncat usage Abusing strncat so a single character can be passed to it instead of a string is nonsense. Signed-off-by: Sultan Alsawaf --- drivers/input/sec_cmd.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/input/sec_cmd.c b/drivers/input/sec_cmd.c index 57bf53c81468..e7a20c8ed1c6 100644 --- a/drivers/input/sec_cmd.c +++ b/drivers/input/sec_cmd.c @@ -53,10 +53,9 @@ static void cmd_exit_work(struct work_struct *work) void sec_cmd_set_default_result(struct sec_cmd_data *data) { - char delim = ':'; memset(data->cmd_result, 0x00, SEC_CMD_RESULT_STR_LEN); memcpy(data->cmd_result, data->cmd, SEC_CMD_STR_LEN); - strncat(data->cmd_result, &delim, 1); + strcat(data->cmd_result, ":"); } void sec_cmd_set_cmd_result(struct sec_cmd_data *data, char *buff, int len) -- 2.20.1