7b831bd3cf
strncpy() is deprecated for use on NUL-terminated destination strings
[1] and as such we should prefer more robust and less ambiguous string
interfaces.
This kernel config option is simply assigned with the resume_file
buffer. It should be NUL-terminated but not necessarily NUL-padded as
per its further usage with other string apis:
| static int __init find_resume_device(void)
| {
| if (!strlen(resume_file))
| return -ENOENT;
|
| pm_pr_dbg("Checking hibernation image partition %s\n", resume_file);
Use strscpy() [2] as it guarantees NUL-termination on the destination
buffer. Specifically, use the new 2-argument version of strscpy()
introduced in Commit
|
||
---|---|---|
.. | ||
autosleep.c | ||
console.c | ||
energy_model.c | ||
hibernate.c | ||
Kconfig | ||
main.c | ||
Makefile | ||
power.h | ||
poweroff.c | ||
process.c | ||
qos.c | ||
snapshot.c | ||
suspend_test.c | ||
suspend.c | ||
swap.c | ||
user.c | ||
wakelock.c |