Commit 8e5c0cc
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>1 parent a2b4d0f commit 8e5c0cc
1 file changed
Lines changed: 8 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11536 | 11536 | | |
11537 | 11537 | | |
11538 | 11538 | | |
11539 | | - | |
| 11539 | + | |
| 11540 | + | |
11540 | 11541 | | |
11541 | | - | |
11542 | | - | |
| 11542 | + | |
| 11543 | + | |
11543 | 11544 | | |
11544 | 11545 | | |
11545 | 11546 | | |
11546 | 11547 | | |
11547 | | - | |
| 11548 | + | |
| 11549 | + | |
11548 | 11550 | | |
11549 | | - | |
11550 | | - | |
| 11551 | + | |
| 11552 | + | |
11551 | 11553 | | |
11552 | 11554 | | |
11553 | 11555 | | |
| |||
0 commit comments