diff mbox series

[04/47] libsemanage: drop dead assignments

Message ID 20241111141706.38039-4-cgoettsche@seltendoof.de (mailing list archive)
State New
Delegated to: Petr Lautrbach
Headers show
Series [01/47] libsemanage: white space cleanup | expand

Commit Message

Christian Göttsche Nov. 11, 2024, 2:16 p.m. UTC
From: Christian Göttsche <cgzones@googlemail.com>

Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
---
 libsemanage/src/compressed_file.c | 2 +-
 libsemanage/src/direct_api.c      | 4 ++--
 libsemanage/src/semanage_store.c  | 4 +---
 libsemanage/src/users_base_file.c | 2 +-
 4 files changed, 5 insertions(+), 7 deletions(-)
diff mbox series

Patch

diff --git a/libsemanage/src/compressed_file.c b/libsemanage/src/compressed_file.c
index e230a70b..067f54d7 100644
--- a/libsemanage/src/compressed_file.c
+++ b/libsemanage/src/compressed_file.c
@@ -45,7 +45,7 @@  static int bzip(semanage_handle_t *sh, const char *filename, void *data,
 	size_t  size = 1<<16;
 	int     bzerror;
 	size_t  total = 0;
-	size_t len = 0;
+	size_t len;
 	FILE *f;
 
 	if ((f = fopen(filename, "wb")) == NULL) {
diff --git a/libsemanage/src/direct_api.c b/libsemanage/src/direct_api.c
index 84c31399..104dbd40 100644
--- a/libsemanage/src/direct_api.c
+++ b/libsemanage/src/direct_api.c
@@ -582,7 +582,7 @@  cleanup:
 static int read_from_pipe_to_data(semanage_handle_t *sh, size_t initial_len, int fd, char **out_data_read, size_t *out_read_len)
 {
 	size_t max_len = initial_len;
-	ssize_t read_len = 0;
+	ssize_t read_len;
 	size_t data_read_len = 0;
 	char *data_read = NULL;
 
@@ -1001,7 +1001,7 @@  static int semanage_compile_hll_modules(semanage_handle_t *sh,
 	/* to be incremented when checksum input data format changes */
 	static const size_t CHECKSUM_EPOCH = 2;
 
-	int i, status = 0;
+	int i, status;
 	char cil_path[PATH_MAX];
 	struct stat sb;
 	Sha256Context context;
diff --git a/libsemanage/src/semanage_store.c b/libsemanage/src/semanage_store.c
index df994297..82c5a684 100644
--- a/libsemanage/src/semanage_store.c
+++ b/libsemanage/src/semanage_store.c
@@ -2081,7 +2081,7 @@  int semanage_direct_get_serial(semanage_handle_t * sh)
 
 int semanage_load_files(semanage_handle_t * sh, cil_db_t *cildb, char **filenames, int numfiles)
 {
-	int i, retval = 0;
+	int i, retval;
 	char *filename;
 	struct file_contents contents = {};
 
@@ -2557,8 +2557,6 @@  int semanage_fc_sort(semanage_handle_t * sh, const char *buf, size_t buf_len,
 	semanage_file_context_bucket_t *main;
 	semanage_file_context_bucket_t *bcurrent;
 
-	i = 0;
-
 	if (sh == NULL) {
 		return -1;
 	}
diff --git a/libsemanage/src/users_base_file.c b/libsemanage/src/users_base_file.c
index a0f8cd7e..4e4d8d9b 100644
--- a/libsemanage/src/users_base_file.c
+++ b/libsemanage/src/users_base_file.c
@@ -66,7 +66,7 @@  static int user_base_parse(semanage_handle_t * handle,
 			   parse_info_t * info, semanage_user_base_t * user)
 {
 
-	int islist = 0;
+	int islist;
 	char *str = NULL;
 	char *start;
 	char *name_str = NULL;