examples/l2fwd-crypto: fix uninitialized errno value
authorHemant Agrawal <hemant.agrawal@nxp.com>
Wed, 23 Aug 2017 12:24:03 +0000 (17:54 +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: 1df9c0109f4c ("examples/l2fwd-crypto: parse key parameters")
Cc: stable@dpdk.org
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Reviewed-by: Kirill Rybalchenko <kirill.rybalchenko@intel.com>
examples/l2fwd-crypto/main.c

index f020be3..17673a3 100644 (file)
@@ -1088,6 +1088,7 @@ parse_key(uint8_t *data, char *input_arg)
        unsigned byte_count;
        char *token;
 
+       errno = 0;
        for (byte_count = 0, token = strtok(input_arg, ":");
                        (byte_count < MAX_KEY_SIZE) && (token != NULL);
                        token = strtok(NULL, ":")) {