Blame SOURCES/fstrm-0.6.1-Fix-deadcode-and-check-return-code.patch

e0bf0f
From 600db5413294701bdfda8ce19fa804bcbc866d2e Mon Sep 17 00:00:00 2001
e0bf0f
From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= <pemensik@redhat.com>
e0bf0f
Date: Fri, 8 Jan 2021 13:23:17 +0100
e0bf0f
Subject: [PATCH 2/3] Fix deadcode and check return code
e0bf0f
e0bf0f
1. fstrm-0.6.0/libmy/argv.c:1782: addr_non_null: The address of an object "argv_types" is never null.
e0bf0f
2. fstrm-0.6.0/libmy/argv.c:1782: assignment: Assigning: "type_p" = "argv_types".
e0bf0f
3. fstrm-0.6.0/libmy/argv.c:1809: notnull: At condition "type_p == NULL", the value of "type_p" cannot be "NULL".
e0bf0f
4. fstrm-0.6.0/libmy/argv.c:1809: dead_error_condition: The condition "type_p == NULL" cannot be true.
e0bf0f
5. fstrm-0.6.0/libmy/argv.c:1810: dead_error_begin: Execution cannot reach this statement: "(void)fprintf(argv_error_st...".
e0bf0f
e0bf0f
40. fstrm-0.6.0/libmy/argv.c:2724: check_return: Calling "string_to_value" without checking return value (as is done elsewhere 6 out of 7 times).
e0bf0f
---
e0bf0f
 libmy/argv.c | 6 ++++--
e0bf0f
 1 file changed, 4 insertions(+), 2 deletions(-)
e0bf0f
e0bf0f
diff --git a/libmy/argv.c b/libmy/argv.c
e0bf0f
index c3aadfe..16dca73 100644
e0bf0f
--- a/libmy/argv.c
e0bf0f
+++ b/libmy/argv.c
e0bf0f
@@ -1806,7 +1806,7 @@ static	void	display_variables(const argv_t *args)
e0bf0f
       int		entry_c, size = 0;
e0bf0f
       
e0bf0f
       /* find the type and the size for array */
e0bf0f
-      if (type_p == NULL) {
e0bf0f
+      if (type_p->at_value == 0) {
e0bf0f
 	(void)fprintf(argv_error_stream, "%s: illegal variable type %d\n",
e0bf0f
 		      __FILE__, val_type);
e0bf0f
 	continue;
e0bf0f
@@ -2721,7 +2721,9 @@ static	void	do_list(argv_t *grid, const int arg_c, char **argv,
e0bf0f
 	    case ARGV_LONG:
e0bf0f
 	    case ARGV_FLOAT:
e0bf0f
 	    case ARGV_DOUBLE:
e0bf0f
-              string_to_value(*arg_p, match_p->ar_variable, match_p->ar_type);
e0bf0f
+              if (string_to_value(*arg_p, match_p->ar_variable, match_p->ar_type) != NOERROR) {
e0bf0f
+		*okay_bp = ARGV_FALSE;
e0bf0f
+	      }
e0bf0f
 	      char_c = len;
e0bf0f
 	      /* we actually used it so we advance the queue tail position */
e0bf0f
 	      (*queue_tail_p)++;
e0bf0f
-- 
e0bf0f
2.26.3
e0bf0f