x86_energy_perf_policy: Cleanup: Use snprintf() for platform-profile

Better hygiene to use snprintf() instead of strcpy().

Assisted-by: GitHub-Copilot:Claude-Sonnet-4.6
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
This commit is contained in:
Len Brown 2026-05-06 10:00:00 -04:00
parent 0aaac38a0d
commit db2cffbc80

View File

@ -678,7 +678,7 @@ void cmdline(int argc, char **argv)
errx(1, "--platform-profile: value too long");
if (!platform_profile_access(W_OK))
errx(1, "Can not update platform-profile in '%s'", PATH_PLATFORM_PROFILE);
strcpy(platform_profile, optarg);
snprintf(platform_profile, sizeof(platform_profile), "%s", optarg);
update_platform_profile = 1;
break;
case 'm':