errno should be initialized to 0 before calling strtol
Fixes: f6cefe253cc8 ("app/crypto-perf: add range/list of sizes")
Cc: [email protected]
Signed-off-by: Hemant Agrawal <[email protected]>
Reviewed-by: Kirill Rybalchenko <[email protected]>
---
app/test-crypto-perf/cperf_options_parsing.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/app/test-crypto-perf/cperf_options_parsing.c
b/app/test-crypto-perf/cperf_options_parsing.c
index 085aa8f..663f53f 100644
--- a/app/test-crypto-perf/cperf_options_parsing.c
+++ b/app/test-crypto-perf/cperf_options_parsing.c
@@ -137,6 +137,7 @@ parse_range(const char *arg, uint32_t *min, uint32_t *max,
uint32_t *inc)
if (copy_arg == NULL)
return -1;
+ errno = 0;
token = strtok(copy_arg, ":");
/* Parse minimum value */
@@ -203,6 +204,7 @@ parse_list(const char *arg, uint32_t *list, uint32_t *min,
uint32_t *max)
if (copy_arg == NULL)
return -1;
+ errno = 0;
token = strtok(copy_arg, ",");
/* Parse first value */
--
2.7.4