]> git.ipfire.org Git - thirdparty/linux.git/commit
tools/power turbostat: Use strtoul() for iteration parsing
authorKaushlendra Kumar <kaushlendra.kumar@intel.com>
Mon, 8 Dec 2025 03:08:04 +0000 (08:38 +0530)
committerLen Brown <len.brown@intel.com>
Fri, 13 Feb 2026 20:03:17 +0000 (14:03 -0600)
commit8e5c0cc326f2e95a71bb6e6063e65caa60c8f951
tree5b6dfabd7c0a333fd1454cf1f660dd66a58e0971
parenta2b4d0f8bf07a4a4fe8a526e10c45e593c7a3bf0
tools/power turbostat: Use strtoul() for iteration parsing

Replace strtod() with strtoul() and check errno for -n/-N options, since
num_iterations and header_iterations are unsigned long counters. Reject
zero and conversion errors; negative inputs wrap to large positive values
per standard unsigned semantics.

Signed-off-by: Kaushlendra Kumar <kaushlendra.kumar@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
tools/power/x86/turbostat/turbostat.c