Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/arm/sunxi Simplify, and avoid compiler warning for ...



details:   https://anonhg.NetBSD.org/src/rev/c8d1f55d6fe8
branches:  trunk
changeset: 827526:c8d1f55d6fe8
user:      pgoyette <pgoyette%NetBSD.org@localhost>
date:      Wed Nov 01 01:47:00 2017 +0000

description:
Simplify, and avoid compiler warning for variable format string.

As discussed on IRC.

diffstat:

 sys/arch/arm/sunxi/sunxi_thermal.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (29 lines):

diff -r ec06ccc520cc -r c8d1f55d6fe8 sys/arch/arm/sunxi/sunxi_thermal.c
--- a/sys/arch/arm/sunxi/sunxi_thermal.c        Tue Oct 31 21:53:48 2017 +0000
+++ b/sys/arch/arm/sunxi/sunxi_thermal.c        Wed Nov 01 01:47:00 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sunxi_thermal.c,v 1.1 2017/10/05 01:30:26 jmcneill Exp $ */
+/* $NetBSD: sunxi_thermal.c,v 1.2 2017/11/01 01:47:00 pgoyette Exp $ */
 
 /*-
  * Copyright (c) 2016-2017 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sunxi_thermal.c,v 1.1 2017/10/05 01:30:26 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunxi_thermal.c,v 1.2 2017/11/01 01:47:00 pgoyette Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -552,8 +552,8 @@
                sc->data[i].private = i;
                sc->data[i].units = ENVSYS_STEMP;
                sc->data[i].state = ENVSYS_SINVALID;
-               snprintf(sc->data[i].desc, sizeof(sc->data[i].desc),
-                   sc->conf->sensors[i].desc);
+               strlcpy(sc->data[1].desc, sc->conf->sensors[i].desc,
+                   sizeof(sc->data[1].desc);
                sysmon_envsys_sensor_attach(sc->sme, &sc->data[i]);
        }
        sysmon_envsys_register(sc->sme);



Home | Main Index | Thread Index | Old Index