]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
udevadm: split assertions
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 21 Jan 2022 15:16:35 +0000 (00:16 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 21 Jan 2022 15:16:38 +0000 (00:16 +0900)
Then we can easily find which pointer is NULL.

src/udev/udevadm-info.c

index 3535517183a652269275ba1951c4cc48d0478ad5..a825f17c06364ceae3763d7105898f35eabd60d7 100644 (file)
@@ -266,7 +266,8 @@ static void cleanup_dir(DIR *dir, mode_t mask, int depth) {
 static bool cleanup_dir_after_db_cleanup(DIR *dir, DIR *datadir) {
         unsigned int kept = 0;
 
-        assert(dir && datadir);
+        assert(dir);
+        assert(datadir);
 
         FOREACH_DIRENT_ALL(dent, dir, break) {
                 struct stat data_stats, link_stats;
@@ -291,8 +292,8 @@ static bool cleanup_dir_after_db_cleanup(DIR *dir, DIR *datadir) {
 }
 
 static void cleanup_dirs_after_db_cleanup(DIR *dir, DIR *datadir) {
-
-        assert(dir && datadir);
+        assert(dir);
+        assert(datadir);
 
         FOREACH_DIRENT_ALL(dent, dir, break) {
                 struct stat stats;