touchscreen: sec_ts: Fix horrible strncat usage
authorSultan Alsawaf <sultan@kerneltoast.com>
Sun, 24 Mar 2019 01:52:54 +0000 (18:52 -0700)
committerivanmeler <i_ivan@windowslive.com>
Fri, 6 May 2022 16:26:12 +0000 (16:26 +0000)
Abusing strncat so a single character can be passed to it instead of a
string is nonsense.

Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
drivers/input/sec_cmd.c

index 57bf53c8146820703c9b0ec2acff75f14d5184fa..e7a20c8ed1c626e39ebf29bc8bc40765bb9637fc 100644 (file)
@@ -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)