smbd: Simplify fsp_fullbasepath()
commit5246267d173964aed8c6ff585baec18a261e18d0
authorVolker Lendecke <vl@samba.org>
Sun, 4 Feb 2024 09:57:28 +0000 (4 10:57 +0100)
committerVolker Lendecke <vl@samba.org>
Tue, 12 Mar 2024 13:31:31 +0000 (12 13:31 +0000)
tree305206f759f57461fbe2df66ca2f02b8bf9d40af
parentbe15ab4c785d0868647269c931edbf07defe990e
smbd: Simplify fsp_fullbasepath()

snprintf deals well with NULL/0 buffers. Basically this undoes
6555fa9d8fbc and 193df6176555fa9d8fbc gave cppcheck as a reason for
this patch, but if I look into susv4's snprintf definition I find:

If n is zero, nothing shall be written and s may be a null pointer.

This removes the checks and makes sure we fulfill the requirement of
susv4 that states that buf can only be NULL if buflen is 0.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source3/smbd/files.c