Message ID | 1334132026-14470-1-git-send-email-colin.king@canonical.com |
---|---|
State | Accepted |
Headers | show |
On Wed, Apr 11, 2012 at 4:13 PM, Colin King <colin.king@canonical.com> wrote: > From: Colin Ian King <colin.king@canonical.com> > > Signed-off-by: Colin Ian King <colin.king@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 > Acked-by: Keng-Yu Lin <kengyu@canonical.com>
On 04/11/2012 04:13 PM, Colin King wrote: > From: Colin Ian King<colin.king@canonical.com> > > Signed-off-by: Colin Ian King<colin.king@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); > } > Acked-by: Alex Hung <alex.hung@canonical.com>
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); }