From: Volker Lendecke Date: Sat, 3 Jan 2026 08:38:58 +0000 (+0100) Subject: printing: Simplify move_driver_to_download_area() X-Git-Tag: tdb-1.4.15~25 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a1831c15789abe8725df272bc42a1a23bf6fb333;p=thirdparty%2Fsamba.git printing: Simplify move_driver_to_download_area() No need to call strlen() here. Just came across this while looking at SMB_VFS_CREATE_FILE callers... Signed-off-by: Volker Lendecke Reviewed-by: Anoop C S --- diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c index 81f5f53962b..7683e312f2e 100644 --- a/source3/printing/nt_printing.c +++ b/source3/printing/nt_printing.c @@ -1593,8 +1593,8 @@ WERROR move_driver_to_download_area(const struct auth_session_info *session_info DEBUG(5,("Moving files now !\n")); - if (driver->driver_path && strlen(driver->driver_path)) { - + if ((driver->driver_path != NULL) && (driver->driver_path[0] != '\0')) + { err = move_driver_file_to_download_area(frame, conn, driver->driver_path, @@ -1607,7 +1607,7 @@ WERROR move_driver_to_download_area(const struct auth_session_info *session_info } } - if (driver->data_file && strlen(driver->data_file)) { + if ((driver->data_file != NULL) && (driver->data_file[0] != '\0')) { if (!strequal(driver->data_file, driver->driver_path)) { err = move_driver_file_to_download_area(frame, @@ -1623,7 +1623,8 @@ WERROR move_driver_to_download_area(const struct auth_session_info *session_info } } - if (driver->config_file && strlen(driver->config_file)) { + if ((driver->config_file != NULL) && (driver->config_file[0] != '\0')) + { if (!strequal(driver->config_file, driver->driver_path) && !strequal(driver->config_file, driver->data_file)) { @@ -1640,7 +1641,7 @@ WERROR move_driver_to_download_area(const struct auth_session_info *session_info } } - if (driver->help_file && strlen(driver->help_file)) { + if ((driver->help_file != NULL) && (driver->help_file[0] != '\0')) { if (!strequal(driver->help_file, driver->driver_path) && !strequal(driver->help_file, driver->data_file) && !strequal(driver->help_file, driver->config_file)) {