From: Volker Lendecke Date: Mon, 4 Jan 2021 13:10:57 +0000 (+0100) Subject: ctdb: Use hex_byte() in hex_to_data() X-Git-Tag: samba-4.14.0rc1~149 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6aa672a41c37c94afd86e4801b9c1319db0cc6f3;p=thirdparty%2Fsamba.git ctdb: Use hex_byte() in hex_to_data() Signed-off-by: Volker Lendecke Reviewed-by: Ralph Boehme Reviewed-by: Jeremy Allison --- diff --git a/ctdb/tools/ctdb.c b/ctdb/tools/ctdb.c index e21d2d4b562..598ab4ff4b7 100644 --- a/ctdb/tools/ctdb.c +++ b/ctdb/tools/ctdb.c @@ -591,17 +591,6 @@ static bool db_exists(TALLOC_CTX *mem_ctx, struct ctdb_context *ctdb, return true; } -static int h2i(char h) -{ - if (h >= 'a' && h <= 'f') { - return h - 'a' + 10; - } - if (h >= 'A' && h <= 'F') { - return h - 'A' + 10; - } - return h - '0'; -} - static int hex_to_data(const char *str, size_t len, TALLOC_CTX *mem_ctx, TDB_DATA *out) { @@ -621,7 +610,11 @@ static int hex_to_data(const char *str, size_t len, TALLOC_CTX *mem_ctx, } for (i=0; i