soc: qcom: cmd-db: refactor deprecated strncpy
Subsystems (2)
PATCH 1/1 soc: qcom: cmd-db: refactor deprecated strncpy
Prefer strscpy_pad to strncpy.
Signed-off-by Shubh <[email protected]>
--- drivers/soc/qcom/cmd-db.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/soc/qcom/cmd-db.c +1 -1
@@ -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];
Signature · 1 line
2.42.0
Quoted 3 lines · Shubh
Prefer
strscpy_padtostrncpy.Signed-off-by Shubh <[email protected]>
Please spell out your name on future patches.
Quoted 9 lines
--- drivers/soc/qcom/cmd-db.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/soc/qcom/cmd-db.c +0
-0
drivers/soc/qcom/cmd-db.c static int cmd_db_get_header(const char *id, const struct entry_header **eh, · line 155
Quoted 5 lines
drivers/soc/qcom/cmd-db.c +1
-1@@ -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));
Please read the comment above, and please read fe72f9bce137 ("soc: qcom:
cmd-db: replace strscpy_pad() with strncpy()")
Thanks,
Bjorn
Quoted 6 lines
drivers/soc/qcom/cmd-db.c +0
-0for (i =0 ; i <MAX_SLV_ID ; i++) { rsc_hdr = &cmd_db_header->header[i];Signature · 1 line
2.42.0