From 6d8690ecd34a6c9450e78e242e07b1a4479d6d27 Mon Sep 17 00:00:00 2001 From: Mike Yuan Date: Tue, 16 Apr 2024 01:28:20 +0800 Subject: [PATCH] shared/vpick: align function args correctly, add missing assertion --- src/shared/vpick.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/shared/vpick.c b/src/shared/vpick.c index 6f15a7070d1..5e2b34e7b08 100644 --- a/src/shared/vpick.c +++ b/src/shared/vpick.c @@ -141,6 +141,7 @@ static int pin_choice( assert(toplevel_fd >= 0 || toplevel_fd == AT_FDCWD); assert(inode_path); assert(filter); + assert(ret); toplevel_path = strempty(toplevel_path); @@ -271,6 +272,7 @@ static int make_choice( assert(toplevel_fd >= 0 || toplevel_fd == AT_FDCWD); assert(inode_path); assert(filter); + assert(ret); toplevel_path = strempty(toplevel_path); @@ -486,12 +488,13 @@ static int make_choice( ret); } -int path_pick(const char *toplevel_path, - int toplevel_fd, - const char *path, - const PickFilter *filter, - PickFlags flags, - PickResult *ret) { +int path_pick( + const char *toplevel_path, + int toplevel_fd, + const char *path, + const PickFilter *filter, + PickFlags flags, + PickResult *ret) { _cleanup_free_ char *filter_bname = NULL, *dir = NULL, *parent = NULL, *fname = NULL; const char *filter_suffix, *enumeration_path; @@ -500,6 +503,8 @@ int path_pick(const char *toplevel_path, assert(toplevel_fd >= 0 || toplevel_fd == AT_FDCWD); assert(path); + assert(filter); + assert(ret); toplevel_path = strempty(toplevel_path); @@ -647,6 +652,7 @@ int path_pick_update_warn( assert(path); assert(*path); + assert(filter); /* This updates the first argument if needed! */ -- 2.47.3