app/crypto-perf: fix uninitialized errno value
authorHemant Agrawal <hemant.agrawal@nxp.com>
Tue, 5 Sep 2017 06:17:01 +0000 (11:47 +0530)
committerPablo de Lara <pablo.de.lara.guarch@intel.com>
Thu, 12 Oct 2017 07:21:24 +0000 (08:21 +0100)
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 <hemant.agrawal@nxp.com>
Reviewed-by: Kirill Rybalchenko <kirill.rybalchenko@intel.com>
app/test-crypto-perf/cperf_options_parsing.c

index 085aa8f..663f53f 100644 (file)
@@ -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 */