lkml.org 
[lkml]   [2023]   [Oct]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] soc: qcom: cmd-db: refactor deprecated strncpy
Date
Prefer `strscpy_pad` to `strncpy`.

Signed-off-by: Shubh <shubhisroking@gmail.com>
---
drivers/soc/qcom/cmd-db.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/soc/qcom/cmd-db.c b/drivers/soc/qcom/cmd-db.c
index 34c40368d..dc42704d7 100644
--- a/drivers/soc/qcom/cmd-db.c
+++ b/drivers/soc/qcom/cmd-db.c
@@ -152,7 +152,7 @@ static int cmd_db_get_header(const char *id, const struct entry_header **eh,
* query string is not necessarily '\0' terminated if it bumps up
* against the max size. That's OK and expected.
*/
- strncpy(query, id, sizeof(query));
+ strscpy_pad(query, id, sizeof(query));

for (i = 0; i < MAX_SLV_ID; i++) {
rsc_hdr = &cmd_db_header->header[i];
--
2.42.0
\
 
 \ /
  Last update: 2023-10-04 08:56    [W:6.466 / U:0.084 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site