]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: Simplify full_path_extend()
authorVolker Lendecke <vl@samba.org>
Wed, 15 Jul 2026 10:10:42 +0000 (12:10 +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/smbd/files.c

index 1df5a5846c4b2ff871845805da8fc163c6f8a594..d626ac5f32e6a843b1df74e11eddbf2439cd9b5c 100644 (file)
@@ -926,10 +926,7 @@ fail:
 
 static bool full_path_extend(char **dir, const char *atname)
 {
-       talloc_asprintf_addbuf(dir,
-                              "%s%s",
-                              (*dir)[0] == '\0' ? "" : "/",
-                              atname);
+       talloc_asprintf_addsep(dir, "/", "%s", atname);
        return (*dir) != NULL;
 }