Module Name:    src
Committed By:   pgoyette
Date:           Wed Nov  1 01:47:00 UTC 2017

Modified Files:
        src/sys/arch/arm/sunxi: sunxi_thermal.c

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

As discussed on IRC.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/sunxi/sunxi_thermal.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/sunxi/sunxi_thermal.c
diff -u src/sys/arch/arm/sunxi/sunxi_thermal.c:1.1 src/sys/arch/arm/sunxi/sunxi_thermal.c:1.2
--- src/sys/arch/arm/sunxi/sunxi_thermal.c:1.1	Thu Oct  5 01:30:26 2017
+++ src/sys/arch/arm/sunxi/sunxi_thermal.c	Wed Nov  1 01:47:00 2017
@@ -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 <jmcne...@invisible.ca>
@@ -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 @@ sunxi_thermal_attach(device_t parent, de
 		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);

Reply via email to