Skip to content

Commit c662a6f

Browse files
osamakadertsbogend
authored andcommitted
mips: math-emu: replace deprecated strcpy() in me-debugfs
use strscpy() instead of deprecated strcpy(). Signed-off-by: Osama Abdelkader <[email protected]> Signed-off-by: Thomas Bogendoerfer <[email protected]>
1 parent ad79935 commit c662a6f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

arch/mips/math-emu/me-debugfs.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ DEFINE_SIMPLE_ATTRIBUTE(fops_fpuemu_stat, fpuemu_stat_get, NULL, "%llu\n");
3737
* used in debugfs item names to be clearly associated to corresponding
3838
* MIPS FPU instructions.
3939
*/
40-
static void adjust_instruction_counter_name(char *out_name, char *in_name)
40+
static void adjust_instruction_counter_name(char *out_name, char *in_name, size_t len)
4141
{
4242
int i = 0;
4343

44-
strcpy(out_name, in_name);
44+
strscpy(out_name, in_name, len);
4545
while (in_name[i] != '\0') {
4646
if (out_name[i] == '_')
4747
out_name[i] = '.';
@@ -226,7 +226,7 @@ do { \
226226

227227
#define FPU_STAT_CREATE_EX(m) \
228228
do { \
229-
adjust_instruction_counter_name(name, #m); \
229+
adjust_instruction_counter_name(name, #m, sizeof(name)); \
230230
\
231231
debugfs_create_file(name, 0444, fpuemu_debugfs_inst_dir, \
232232
(void *)FPU_EMU_STAT_OFFSET(m), \

0 commit comments

Comments
 (0)