Message ID | 20161019132639.16524-5-colin.king@canonical.com |
---|---|
State | Accepted |
Headers | show |
On 2016-10-19 06:26 AM, Colin King wrote: > From: Colin Ian King <colin.king@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@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; > > Acked-by: Alex Hung <alex.hung@canonical.com>
On 2016年10月19日 21:26, Colin King wrote: > From: Colin Ian King <colin.king@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@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; > > Acked-by: Ivan Hu <ivan.hu@canonical.com>
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;