From: Stephen Hemminger Date: Sun, 19 Feb 2017 00:17:43 +0000 (-0800) Subject: utils: hex2mem get rid of unnecessary goto X-Git-Tag: v4.10.0~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2bf1a81a2f0cd9d1e0f7aea93ea49185e7fb5ddf;p=thirdparty%2Fiproute2.git utils: hex2mem get rid of unnecessary goto Signed-off-by: Stephen Hemminger --- diff --git a/lib/utils.c b/lib/utils.c index 870c4f1b8..6d5642f4f 100644 --- a/lib/utils.c +++ b/lib/utils.c @@ -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)