Thomas Jarosch
2011-Aug-27 23:02 UTC
[Nut-upsdev] [PATCH 2/3] Fix use of uninitialized variable
Credit goes to "cppcheck". Signed-off-by: Thomas Jarosch <thomas.jarosch at intra2net.com> --- drivers/mge-utalk.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/drivers/mge-utalk.c b/drivers/mge-utalk.c index c6114c7..616e2ad 100644 --- a/drivers/mge-utalk.c +++ b/drivers/mge-utalk.c @@ -465,7 +465,8 @@ void upsdrv_shutdown(void) { char buf[BUFFLEN]; /* static time_t lastcmd = 0; */ - + memset(buf, 0, sizeof(buf)); + if (sdtype == SD_RETURN) { /* enable automatic restart */ mge_command(buf, sizeof(buf), "Sx 5"); -- 1.7.4.4
EmilienKia at Eaton.com
2011-Aug-31 13:21 UTC
[Nut-upsdev] [PATCH 2/3] Fix use of uninitialized variable
Hi Thomas> -----Message d'origine----- > De : > nut-upsdev-bounces+emilienkia=eaton.com at lists.alioth.debian.or > g > [mailto:nut-upsdev-bounces+emilienkia=eaton.com at lists.alioth.d > ebian.org] De la part de Thomas Jarosch > Envoy? : dimanche 28 ao?t 2011 01:03 > ? : nut-upsdev at lists.alioth.debian.org > Objet : [Nut-upsdev] [PATCH 2/3] Fix use of uninitialized variable > > Credit goes to "cppcheck". > > Signed-off-by: Thomas Jarosch <thomas.jarosch at intra2net.com> > --- > drivers/mge-utalk.c | 3 ++- > 1 files changed, 2 insertions(+), 1 deletions(-) > > diff --git a/drivers/mge-utalk.c b/drivers/mge-utalk.c index > c6114c7..616e2ad 100644 > --- a/drivers/mge-utalk.c > +++ b/drivers/mge-utalk.c > @@ -465,7 +465,8 @@ void upsdrv_shutdown(void) { > char buf[BUFFLEN]; > /* static time_t lastcmd = 0; */ > - > + memset(buf, 0, sizeof(buf)); > + > if (sdtype == SD_RETURN) { > /* enable automatic restart */ > mge_command(buf, sizeof(buf), "Sx 5"); > -- > 1.7.4.4 > >Thanks for your patch. I have just applied it to the trunk (r3172). Best regards Emilien KIA Opensource Team Engineering Software & Connectivity Eaton's Electrical Group PQCO/DPQD emilienkia at eaton.com www.eaton.com --------------------------------------------------------------------------