From: Hemant Agrawal Date: Tue, 5 Sep 2017 06:17:01 +0000 (+0530) Subject: app/crypto-perf: fix uninitialized errno value X-Git-Tag: spdx-start~1444 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=5c49049dd9d265f9a2086020ec7c34d3bce3c037;p=dpdk.git app/crypto-perf: fix uninitialized errno value errno should be initialized to 0 before calling strtol Fixes: f6cefe253cc8 ("app/crypto-perf: add range/list of sizes") Cc: stable@dpdk.org Signed-off-by: Hemant Agrawal Reviewed-by: Kirill Rybalchenko --- diff --git a/app/test-crypto-perf/cperf_options_parsing.c b/app/test-crypto-perf/cperf_options_parsing.c index 085aa8fe81..663f53fe26 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 */