Module Name:    src
Committed By:   christos
Date:           Wed Mar 26 17:41:15 UTC 2014

Modified Files:
        src/sys/arch/evbmips/loongson: loongson_intr.c
        src/sys/arch/evbmips/malta/pci: pcib.c

Log Message:
kill sprintf


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/evbmips/loongson/loongson_intr.c
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/evbmips/malta/pci/pcib.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/evbmips/loongson/loongson_intr.c
diff -u src/sys/arch/evbmips/loongson/loongson_intr.c:1.2 src/sys/arch/evbmips/loongson/loongson_intr.c:1.3
--- src/sys/arch/evbmips/loongson/loongson_intr.c:1.2	Sat Oct 27 13:17:50 2012
+++ src/sys/arch/evbmips/loongson/loongson_intr.c	Wed Mar 26 13:41:15 2014
@@ -1,4 +1,4 @@
-/*      $NetBSD: loongson_intr.c,v 1.2 2012/10/27 17:17:50 chs Exp $      */
+/*      $NetBSD: loongson_intr.c,v 1.3 2014/03/26 17:41:15 christos Exp $      */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: loongson_intr.c,v 1.2 2012/10/27 17:17:50 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: loongson_intr.c,v 1.3 2014/03/26 17:41:15 christos Exp $");
 
 #define __INTR_PRIVATE
 
@@ -126,7 +126,7 @@ evbmips_intr_init(void)
 		static char irqstr[8];
 		for (irq = 0; irq < BONITO_NISA; irq++) {
 			i = BONITO_ISA_IRQ(irq);
-			sprintf(irqstr, "irq %d", irq);
+			snprintf(irqstr, sizeof(irqstr), "irq %d", irq);
 			DPRINTF(("attach %d %d %s\n", i, irq, irqstr));
 			evcnt_attach_dynamic(&bonito_intrhead[i].intr_count,
 			    EVCNT_TYPE_INTR, NULL, "isa", irqstr);
@@ -334,7 +334,8 @@ loongson_intr_string(const struct bonito
 {
 	static char irqstr[12]; /* 8 + 2 + NULL + sanity */
 	if (BONITO_IRQ_IS_ISA(irq)) {
-		sprintf(irqstr, "isa irq %d", BONITO_IRQ_TO_ISA(irq));
+		snprintf(irqstr, sizeof(irqstr), "isa irq %d",
+		    BONITO_IRQ_TO_ISA(irq));
 		return irqstr;
 	}
 	return sys_platform->irq_map[irq].name;

Index: src/sys/arch/evbmips/malta/pci/pcib.c
diff -u src/sys/arch/evbmips/malta/pci/pcib.c:1.16 src/sys/arch/evbmips/malta/pci/pcib.c:1.17
--- src/sys/arch/evbmips/malta/pci/pcib.c:1.16	Sat Oct 27 13:17:51 2012
+++ src/sys/arch/evbmips/malta/pci/pcib.c	Wed Mar 26 13:41:15 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: pcib.c,v 1.16 2012/10/27 17:17:51 chs Exp $	*/
+/*	$NetBSD: pcib.c,v 1.17 2014/03/26 17:41:15 christos Exp $	*/
 
 /*
  * Copyright 2002 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pcib.c,v 1.16 2012/10/27 17:17:51 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pcib.c,v 1.17 2014/03/26 17:41:15 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -306,7 +306,7 @@ pcib_attach(device_t parent, device_t se
 #if 0
 		char irqstr[8];		/* 4 + 2 + NULL + sanity */
 
-		sprintf(irqstr, "irq %d", i);
+		snprintf(irqstr, sizeof(irqstr), "irq %d", i);
 		evcnt_attach_dynamic(&sc->sc_intrtab[i].intr_count,
 		    EVCNT_TYPE_INTR, NULL, "pcib", irqstr);
 #else
@@ -469,7 +469,7 @@ pcib_isa_intr_string(void *v, int irq)
 	if (irq == 0 || irq >= ICU_LEN || irq == 2)
 		panic("pcib_isa_intr_string: bogus isa irq 0x%x", irq);
 
-	sprintf(irqstr, "isa irq %d", irq);
+	snprintf(irqstr, sizeof(irqstr), "isa irq %d", irq);
 	return (irqstr);
 }
 

Reply via email to