From patchwork Wed Apr 11 08:13:46 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Ian King X-Patchwork-Id: 151740 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from chlorine.canonical.com (chlorine.canonical.com [91.189.94.204]) by ozlabs.org (Postfix) with ESMTP id 32252B704D for ; Wed, 11 Apr 2012 18:13:50 +1000 (EST) Received: from localhost ([127.0.0.1] helo=chlorine.canonical.com) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1SHsgX-0003Zr-0e for incoming@patchwork.ozlabs.org; Wed, 11 Apr 2012 08:13:49 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1SHsgV-0003ZX-64 for fwts-devel@lists.ubuntu.com; Wed, 11 Apr 2012 08:13:47 +0000 Received: from cpc19-craw6-2-0-cust5.croy.cable.virginmedia.com ([77.102.228.6] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1SHsgV-0006TG-3b for fwts-devel@lists.ubuntu.com; Wed, 11 Apr 2012 08:13:47 +0000 From: Colin King To: fwts-devel@lists.ubuntu.com Subject: [PATCH][RESUBMIT] lib: fwts_fileio.c: remove unnecessary variable len Date: Wed, 11 Apr 2012 09:13:46 +0100 Message-Id: <1334132026-14470-1-git-send-email-colin.king@canonical.com> X-Mailer: git-send-email 1.7.9.1 X-BeenThere: fwts-devel@lists.ubuntu.com X-Mailman-Version: 2.1.13 Precedence: list List-Id: Firmware Test Suite Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: fwts-devel-bounces@lists.ubuntu.com Errors-To: fwts-devel-bounces@lists.ubuntu.com From: Colin Ian King Signed-off-by: Colin Ian King Acked-by: Keng-Yu Lin Acked-by: Alex Hung --- 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); }