From fb1223e91bb49d3a91b869d4c347e86566481ee5 Mon Sep 17 00:00:00 2001 From: Pasha Date: Wed, 19 Jul 2023 08:05:25 +0000 Subject: fix sizeof of known value --- src/main.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index bc10112..64b1ba3 100644 --- a/src/main.c +++ b/src/main.c @@ -28,8 +28,7 @@ enum output_pref { DEFAULT = 0, PATH = 1, CGROUPID = 2 }; static inline void print_cgroup_file_handle(const char *pathname, enum output_pref output_type) { - unsigned char *cgroupfhp = - (unsigned char *)malloc(sizeof(unsigned char) * CGROUP_FILE_HANDLE_BYTES); + unsigned char *cgroupfhp = (unsigned char *)malloc(CGROUP_FILE_HANDLE_BYTES); if (!cgroupfhp) { fprintf(stderr, "Cannot allocate memory for cgroup file handle\n"); return; @@ -116,8 +115,8 @@ static int display_controller_data(char *ctr_name, char *ctr_path, base_path[1] = '\0'; depth = 0; - ret = - cgroup_walk_tree_begin(ctr_name, base_path, depth, &handle, &info, &base_level); + ret = cgroup_walk_tree_begin(ctr_name, base_path, depth, &handle, &info, + &base_level); if (ret != 0) return ret; @@ -136,7 +135,8 @@ static int display_controller_data(char *ctr_name, char *ctr_path, return 1; } - while ((ret = cgroup_walk_tree_next(depth, &handle, &info, base_level)) == 0) { + while ((ret = cgroup_walk_tree_next(depth, &handle, &info, base_level)) == + 0) { if (compare_cgroup_search_name(info.path, cgroup_search_name)) { print_info(&info, len, ctr_path, output_type); break; -- cgit v1.2.1