[PATCH 4/7] lib: fwts_pipeio: remove redundant initializations of file to NULL

Colin King colin.king at canonical.com
Wed Oct 19 13:26:36 UTC 2016


From: Colin Ian King <colin.king at canonical.com>

The open assigns file to the open descriptor, so no need to initialize
it to NULL.  Cleans up 2 cppcheck style warnings:

src/lib/src/fwts_pipeio.c:397: (style) Variable 'file' is reassigned a
  value before the old one has been used.
src/lib/src/fwts_pipeio.c:429: (style) Variable 'file' is reassigned a
  value before the old one has been used

Signed-off-by: Colin Ian King <colin.king at canonical.com>
---
 src/lib/src/fwts_pipeio.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/lib/src/fwts_pipeio.c b/src/lib/src/fwts_pipeio.c
index ecd4e33..0ee1de1 100644
--- a/src/lib/src/fwts_pipeio.c
+++ b/src/lib/src/fwts_pipeio.c
@@ -390,7 +390,7 @@ int fwts_write_string_file(
 	const char *file_name,
 	const char *str)
 {
-	FILE *file = NULL;
+	FILE *file;
 	int ret;
 
 	errno = 0;
@@ -422,7 +422,7 @@ int fwts_read_file_first_line(
 	const char *file_name,
 	char **line)
 {
-	FILE *file = NULL;
+	FILE *file;
 	char buffer[LINE_MAX], *temp;
 	errno = 0;
 
-- 
2.9.3




More information about the fwts-devel mailing list