[PATCH 4/5] cmapctl: initialize bit_value and check if it's set

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: "Fabio M. Di Nitto" <fdinitto@xxxxxxxxxx>

more gcc warnings...

Signed-off-by: Fabio M. Di Nitto <fdinitto@xxxxxxxxxx>
---
:100644 100644 13da9a1... 17464c3... M	tools/corosync-cmapctl.c
 tools/corosync-cmapctl.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/tools/corosync-cmapctl.c b/tools/corosync-cmapctl.c
index 13da9a1..17464c3 100644
--- a/tools/corosync-cmapctl.c
+++ b/tools/corosync-cmapctl.c
@@ -148,7 +148,7 @@ static void print_key(cmap_handle_t handle,
 		cmap_value_types_t type)
 {
 	char *str;
-	char *bin_value;
+	char *bin_value = NULL;
 	cs_error_t err;
 	int8_t i8;
 	uint8_t u8;
@@ -327,9 +327,13 @@ static void print_key(cmap_handle_t handle,
 		printf("%s)", "bin");
 		if (show_binary) {
 			printf(" = ");
-			print_binary_key(bin_value, value_len);
-			if (value == NULL) {
-				free(bin_value);
+			if (bin_value) {
+				print_binary_key(bin_value, value_len);
+				if (value == NULL) {
+					free(bin_value);
+				}
+			} else {
+				printf("*empty*");
 			}
 		}
 		break;
-- 
1.7.7.5

_______________________________________________
discuss mailing list
discuss@xxxxxxxxxxxx
http://lists.corosync.org/mailman/listinfo/discuss


[Index of Archives]     [Linux Clusters]     [Corosync Project]     [Linux USB Devel]     [Linux Audio Users]     [Photo]     [Yosemite News]    [Yosemite Photos]    [Linux Kernel]     [Linux SCSI]     [X.Org]

  Powered by Linux