[PATCH][RESUBMIT] lib: fwts_fileio.c: remove unnecessary variable len

Colin King colin.king at canonical.com
Wed Apr 11 08:13:46 UTC 2012


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

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

diff --git a/src/lib/src/fwts_fileio.c b/src/lib/src/fwts_fileio.c
index c0a6f15..b3131e3 100644
--- a/src/lib/src/fwts_fileio.c
+++ b/src/lib/src/fwts_fileio.c
@@ -37,8 +37,7 @@ fwts_list *fwts_file_read(FILE *fp)
 		return NULL;
 
 	while (fgets(buffer, sizeof(buffer), fp) != NULL) {
-		int len = strlen(buffer);
-		buffer[len-1] = '\0';	/* Chop off "\n" */
+		buffer[strlen(buffer) - 1] = '\0';	/* Chop off "\n" */
 		fwts_text_list_append(list, buffer);
 	}
 
-- 
1.7.9.1





More information about the fwts-devel mailing list