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

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