modules: Update error check for new string conversion wrapper
authorSwen Schillig <swen@linux.ibm.com>
Wed, 6 Mar 2019 08:34:10 +0000 (09:34 +0100)
committerChristof Schmitt <cs@samba.org>
Thu, 11 Apr 2019 22:29:26 +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>
source3/modules/vfs_snapper.c

index fac4aa698de66852f5b5859d278216f5648eb2e5..39b8ccb097a29fd47a9b8022f0f2a746f43b52a8 100644 (file)
@@ -1216,7 +1216,6 @@ static NTSTATUS snapper_snap_path_to_id(TALLOC_CTX *mem_ctx,
 {
        char *path_dup;
        char *str_idx;
-       char *str_end;
        uint32_t snap_id;
        int error = 0;
 
@@ -1251,8 +1250,8 @@ static NTSTATUS snapper_snap_path_to_id(TALLOC_CTX *mem_ctx,
        }
 
        str_idx++;
-       snap_id = strtoul_err(str_idx, &str_end, 10, &error);
-       if (error != 0 || str_idx == str_end) {
+       snap_id = strtoul_err(str_idx, NULL, 10, &error);
+       if (error != 0) {
                talloc_free(path_dup);
                return NT_STATUS_INVALID_PARAMETER;
        }