From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hemant Agrawal Subject: [PATCH v2] app/crypto-perf: fix uninitialized errno value Date: Tue, 5 Sep 2017 11:47:01 +0530 Message-ID: <1504592221-32022-1-git-send-email-hemant.agrawal@nxp.com> References: <1503491044-27863-2-git-send-email-hemant.agrawal@nxp.com> Mime-Version: 1.0 Content-Type: text/plain Cc: , , To: Return-path: Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0079.outbound.protection.outlook.com [104.47.40.79]) by dpdk.org (Postfix) with ESMTP id 5451D3254 for ; Tue, 5 Sep 2017 08:17:29 +0200 (CEST) In-Reply-To: <1503491044-27863-2-git-send-email-hemant.agrawal@nxp.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 --- 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