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

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