Module Name:    src
Committed By:   christos
Date:           Wed Mar 26 08:04:19 UTC 2014

Modified Files:
        src/sys/arch/x86/x86: cpu_ucode_intel.c platform.c

Log Message:
kill sprintf


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/x86/x86/cpu_ucode_intel.c
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/x86/x86/platform.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/x86/x86/cpu_ucode_intel.c
diff -u src/sys/arch/x86/x86/cpu_ucode_intel.c:1.4 src/sys/arch/x86/x86/cpu_ucode_intel.c:1.5
--- src/sys/arch/x86/x86/cpu_ucode_intel.c:1.4	Fri Nov 15 03:47:55 2013
+++ src/sys/arch/x86/x86/cpu_ucode_intel.c	Wed Mar 26 04:04:19 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu_ucode_intel.c,v 1.4 2013/11/15 08:47:55 msaitoh Exp $ */
+/* $NetBSD: cpu_ucode_intel.c,v 1.5 2014/03/26 08:04:19 christos Exp $ */
 /*
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cpu_ucode_intel.c,v 1.4 2013/11/15 08:47:55 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu_ucode_intel.c,v 1.5 2014/03/26 08:04:19 christos Exp $");
 
 #include "opt_xen.h"
 #include "opt_cpu_ucode.h"
@@ -102,7 +102,8 @@ cpu_ucode_intel_firmware_open(firmware_h
 		return EOPNOTSUPP;
 
 	intel_getcurrentucode(&ucodeversion, &platformid);
-	sprintf(cpuspec, "%08x-%d", cpu_signature, platformid);
+	snprintf(cpuspec, sizeof(cpuspec), "%08x-%d", cpu_signature,
+	    platformid);
 
 	return firmware_open(fw_path, cpuspec, fwh);
 }

Index: src/sys/arch/x86/x86/platform.c
diff -u src/sys/arch/x86/x86/platform.c:1.14 src/sys/arch/x86/x86/platform.c:1.15
--- src/sys/arch/x86/x86/platform.c:1.14	Sat Dec  8 07:36:31 2012
+++ src/sys/arch/x86/x86/platform.c	Wed Mar 26 04:04:19 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: platform.c,v 1.14 2012/12/08 12:36:31 kiyohara Exp $ */
+/* $NetBSD: platform.c,v 1.15 2014/03/26 08:04:19 christos Exp $ */
 
 /*-
  * Copyright (c) 2007 Jared D. McNeill <jmcne...@invisible.ca>
@@ -29,7 +29,7 @@
 #include "isa.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: platform.c,v 1.14 2012/12/08 12:36:31 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: platform.c,v 1.15 2014/03/26 08:04:19 christos Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -242,7 +242,7 @@ platform_add_date(struct smbtable *tbl, 
 		year += 2000;
 	else if (year < 100)
 		year += 1900;
-	sprintf(datestr, "%04u%02u%02u", year, month, day);
+	snprintf(datestr, sizeof(datestr), "%04u%02u%02u", year, month, day);
 	pmf_set_platform(key, datestr);
 	platform_create_sysctl(key);
 }

Reply via email to