]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
vfs_ceph_rgw: Simplify normalise_name()
authorVolker Lendecke <vl@samba.org>
Wed, 15 Jul 2026 10:22:24 +0000 (12:22 +0200)
committerVolker Lendecke <vl@samba.org>
Thu, 30 Jul 2026 13:11:31 +0000 (13:11 +0000)
Use talloc_asprintf_addsep()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
source3/modules/vfs_ceph_rgw.c

index d8d75e1754ddc2688bbe603b9c8fc3969ec81f74..8a7ca204100de3d9c343068c2ef4d9989b43f7d1 100644 (file)
@@ -155,10 +155,7 @@ static char *normalise_name(TALLOC_CTX *ctx, const char *pathname_in)
                if (strcmp(token, ".") == 0 || strcmp(token, "..") == 0) {
                        continue;
                }
-               talloc_asprintf_addbuf(&result,
-                                      "%s%s",
-                                      *result ? "/" : "",
-                                      token);
+               talloc_asprintf_addsep(&result, "/", "%s", token);
        }
 
        TALLOC_FREE(copy);