char buf[BUFF_MAX] = {0};
if (sys_read_buf(fname, buf) == 0) {
- strncpy(str, buf, strlen(buf));
+ memset(str, 0, strlen(buf) + 1);
+ memcpy(str, buf, strlen(buf));
return 0;
}
if (!strncmp(".", dent->d_name, sizeof(".")) || !strncmp("..", dent->d_name, sizeof("..")))
continue;
else {
- strncpy(disp_info[index].bl_name, dent->d_name, sizeof(disp_info[index].bl_name) - 1);
+ memcpy(disp_info[index].bl_name, dent->d_name, sizeof(disp_info[index].bl_name) - 1);
index++;
}
}
if (!strncmp(".", dent->d_name, sizeof(".")) || !strncmp("..", dent->d_name, sizeof("..")))
continue;
else {
- strncpy(disp_info[index].lcd_name, dent->d_name, sizeof(disp_info[index].lcd_name) - 1);
+ memcpy(disp_info[index].lcd_name, dent->d_name, sizeof(disp_info[index].lcd_name) - 1);
index++;
}
}