]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
utils: hex2mem get rid of unnecessary goto
authorStephen Hemminger <stephen@networkplumber.org>
Sun, 19 Feb 2017 00:17:43 +0000 (16:17 -0800)
committerStephen Hemminger <stephen@networkplumber.org>
Sun, 19 Feb 2017 00:18:55 +0000 (16:18 -0800)
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
lib/utils.c

index 870c4f1b8b41e5d725485f54b9edf2c6b6d33413..6d5642f4f1f3fa2ec296f5564e730c30ffd439ed 100644 (file)
@@ -970,21 +970,18 @@ int hex2mem(const char *buf, uint8_t *mem, int count)
        for (i = 0, j = 0; i < count; i++, j += 2) {
                c = get_hex(buf[j]);
                if (c < 0)
-                       goto err;
+                       return -1;
 
                mem[i] = c << 4;
 
                c = get_hex(buf[j + 1]);
                if (c < 0)
-                       goto err;
+                       return -1;
 
                mem[i] |= c;
        }
 
        return 0;
-
-err:
-       return -1;
 }
 
 int addr64_n2a(__u64 addr, char *buff, size_t len)