ctdb-tools: Update error check for new string conversion wrapper
authorSwen Schillig <swen@linux.ibm.com>
Wed, 6 Mar 2019 08:48:24 +0000 (09:48 +0100)
committerChristof Schmitt <cs@samba.org>
Thu, 11 Apr 2019 22:29:27 +0000 (22:29 +0000)
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 <swen@linux.ibm.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
ctdb/tools/ctdb.c

index 6b82bf779a92ba356d7affcf99391533e3c904f2..8db0ec8e7667cfe8936b052f1d1ca1aa09bba193 100644 (file)
@@ -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;
                        }