From 8dda823720b13f436b583346afa7959928a8190d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E5=87=AF?= Date: Sat, 31 Jul 2021 02:46:17 +0000 Subject: [PATCH 1/2] codex fix Signed-off-by: huangkai71 --- model/input/driver/hdf_touch.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/model/input/driver/hdf_touch.c b/model/input/driver/hdf_touch.c index acaadd92c..93a02d010 100644 --- a/model/input/driver/hdf_touch.c +++ b/model/input/driver/hdf_touch.c @@ -457,13 +457,18 @@ static int32_t TouchGetDeviceStrInfo(TouchDriver *driver, int32_t cmd, struct Hd static int32_t TouchGetDeviceAttr(TouchDriver *driver, struct HdfSBuf *reply) { + int32_t ret = 0; if (driver->inputDev == NULL) { return HDF_FAILURE; } HDF_LOGE("%s: enter", __func__); char *tempStr = "main_touch"; - (void)strncpy_s(driver->inputDev->attrSet.devName, DEV_NAME_LEN, tempStr, strlen(tempStr)); + ret = strncpy_s(driver->inputDev->attrSet.devName, DEV_NAME_LEN, tempStr, strlen(tempStr)); + if (ret != 0) { + HDF_LOGE("%s: strncpy_s failed", __func__); + return HDF_FAILURE; + } if (!HdfSbufWriteBuffer(reply, &driver->inputDev->attrSet, sizeof(DevAttr))) { HDF_LOGE("%s: sbuf write dev attr failed", __func__); -- Gitee From a921d9f7068a857b7496139973598ed0e712742f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E5=87=AF?= Date: Sat, 31 Jul 2021 03:46:56 +0000 Subject: [PATCH 2/2] codex fix Signed-off-by: huangkai71 --- model/input/driver/hdf_touch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/model/input/driver/hdf_touch.c b/model/input/driver/hdf_touch.c index 93a02d010..4419e2596 100644 --- a/model/input/driver/hdf_touch.c +++ b/model/input/driver/hdf_touch.c @@ -457,7 +457,7 @@ static int32_t TouchGetDeviceStrInfo(TouchDriver *driver, int32_t cmd, struct Hd static int32_t TouchGetDeviceAttr(TouchDriver *driver, struct HdfSBuf *reply) { - int32_t ret = 0; + int32_t ret; if (driver->inputDev == NULL) { return HDF_FAILURE; } -- Gitee