]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - tools/mxsimage.c
ARM: mxs: tools: Fix errno handling in strtoul() invocation
[karo-tx-uboot.git] / tools / mxsimage.c
index 5db19b216fa2b287deb82c82d2c91a4e39a55f9a..7bd9deef5f0cca908ea775e9e741647faf90d07f 100644 (file)
@@ -502,6 +502,7 @@ static int sb_token_to_long(char *tok, uint32_t *rid)
 
        tok += 2;
 
+       errno = 0;
        id = strtoul(tok, &endptr, 16);
        if ((errno == ERANGE && id == ULONG_MAX) || (errno != 0 && id == 0)) {
                fprintf(stderr, "ERR: Value can't be decoded!\n");