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

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