From 6c1068ac00aca2c914e69dbd81532223180a5615 Mon Sep 17 00:00:00 2001 From: Swen Schillig Date: Wed, 6 Mar 2019 09:48:24 +0100 Subject: [PATCH] ctdb-tools: Update error check for new string conversion wrapper The new string conversion wrappers detect and flag errors which occured during the string to integer conversion. Those modifications required an update of the callees error checks. Signed-off-by: Swen Schillig Reviewed-by: Ralph Boehme Reviewed-by: Christof Schmitt --- ctdb/tools/ctdb.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ctdb/tools/ctdb.c b/ctdb/tools/ctdb.c index 6b82bf779a9..8db0ec8e766 100644 --- a/ctdb/tools/ctdb.c +++ b/ctdb/tools/ctdb.c @@ -325,10 +325,9 @@ static bool parse_nodestring(TALLOC_CTX *mem_ctx, struct ctdb_context *ctdb, tok = strtok(ns, ","); while (tok != NULL) { uint32_t pnn; - char *endptr; - pnn = (uint32_t)strtoul_err(tok, &endptr, 0, &error); - if (error != 0 || (pnn == 0 && tok == endptr)) { + pnn = (uint32_t)strtoul_err(tok, NULL, 0, &error); + if (error != 0) { fprintf(stderr, "Invalid node %s\n", tok); return false; } -- 2.11.4.GIT