Module Name: src Committed By: christos Date: Wed Mar 26 17:47:10 UTC 2014
Modified Files: src/sys/arch/landisk/landisk: shpcic_machdep.c src/sys/arch/landisk/stand/boot: boot2.c cons.c Log Message: kill sprintf To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/sys/arch/landisk/landisk/shpcic_machdep.c cvs rdiff -u -r1.3 -r1.4 src/sys/arch/landisk/stand/boot/boot2.c cvs rdiff -u -r1.1 -r1.2 src/sys/arch/landisk/stand/boot/cons.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/landisk/landisk/shpcic_machdep.c diff -u src/sys/arch/landisk/landisk/shpcic_machdep.c:1.5 src/sys/arch/landisk/landisk/shpcic_machdep.c:1.6 --- src/sys/arch/landisk/landisk/shpcic_machdep.c:1.5 Sat Oct 27 13:17:58 2012 +++ src/sys/arch/landisk/landisk/shpcic_machdep.c Wed Mar 26 13:47:10 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: shpcic_machdep.c,v 1.5 2012/10/27 17:17:58 chs Exp $ */ +/* $NetBSD: shpcic_machdep.c,v 1.6 2014/03/26 17:47:10 christos Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All rights reserved. @@ -35,7 +35,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: shpcic_machdep.c,v 1.5 2012/10/27 17:17:58 chs Exp $"); +__KERNEL_RCSID(0, "$NetBSD: shpcic_machdep.c,v 1.6 2014/03/26 17:47:10 christos Exp $"); #include <sys/types.h> #include <sys/param.h> @@ -125,7 +125,7 @@ landisk_pci_intr_string(void *v, pci_int if (ih == 0) panic("pci_intr_string: bogus handle 0x%x", ih); - sprintf(irqstr, "irq %d", ih); + snprintf(irqstr, sizeof(irqstr), "irq %d", ih); return (irqstr); } Index: src/sys/arch/landisk/stand/boot/boot2.c diff -u src/sys/arch/landisk/stand/boot/boot2.c:1.3 src/sys/arch/landisk/stand/boot/boot2.c:1.4 --- src/sys/arch/landisk/stand/boot/boot2.c:1.3 Sun Dec 25 01:09:09 2011 +++ src/sys/arch/landisk/stand/boot/boot2.c Wed Mar 26 13:47:10 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: boot2.c,v 1.3 2011/12/25 06:09:09 tsutsui Exp $ */ +/* $NetBSD: boot2.c,v 1.4 2014/03/26 17:47:10 christos Exp $ */ /* * Copyright (c) 2003 @@ -183,7 +183,8 @@ sprint_bootsel(const char *filename) const char *file; if (parsebootfile(filename, &devname, &unit, &partition, &file) == 0) { - sprintf(buf, "%s%d%c:%s", devname, unit, 'a' + partition, file); + snprintf(buf, sizeof(buf), "%s%d%c:%s", devname, unit, + 'a' + partition, file); return (buf); } return ("(invalid)"); Index: src/sys/arch/landisk/stand/boot/cons.c diff -u src/sys/arch/landisk/stand/boot/cons.c:1.1 src/sys/arch/landisk/stand/boot/cons.c:1.2 --- src/sys/arch/landisk/stand/boot/cons.c:1.1 Fri Sep 1 17:26:18 2006 +++ src/sys/arch/landisk/stand/boot/cons.c Wed Mar 26 13:47:10 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: cons.c,v 1.1 2006/09/01 21:26:18 uwe Exp $ */ +/* $NetBSD: cons.c,v 1.2 2014/03/26 17:47:10 christos Exp $ */ /*- * Copyright (c) 2005 NONAKA Kimihiro @@ -137,8 +137,8 @@ awaitkey(int timeout, int tell) char numbuf[20]; int len, j; - sprintf(numbuf, "%d ", i / POLL_FREQ); - len = strlen(numbuf); + len = snprintf(numbuf, sizeof(numbuf), + "%d ", i / POLL_FREQ); for (j = 0; j < len; j++) numbuf[len + j] = '\b'; numbuf[len + j] = '\0';