Module Name:    src
Committed By:   christos
Date:           Wed Mar 26 17:58:57 UTC 2014

Modified Files:
        src/sys/arch/i386/stand/boot: boot2.c
        src/sys/arch/i386/stand/dosboot: main.c
        src/sys/arch/i386/stand/lib/test: sanamespace.h

Log Message:
kill sprintf.


To generate a diff of this commit:
cvs rdiff -u -r1.61 -r1.62 src/sys/arch/i386/stand/boot/boot2.c
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/i386/stand/dosboot/main.c
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/i386/stand/lib/test/sanamespace.h

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/i386/stand/boot/boot2.c
diff -u src/sys/arch/i386/stand/boot/boot2.c:1.61 src/sys/arch/i386/stand/boot/boot2.c:1.62
--- src/sys/arch/i386/stand/boot/boot2.c:1.61	Wed Mar 19 21:15:29 2014
+++ src/sys/arch/i386/stand/boot/boot2.c	Wed Mar 26 13:58:57 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: boot2.c,v 1.61 2014/03/20 01:15:29 christos Exp $	*/
+/*	$NetBSD: boot2.c,v 1.62 2014/03/26 17:58:57 christos Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -228,7 +228,8 @@ sprint_bootsel(const char *filename)
 
 	if (parsebootfile(filename, &fsname, &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/i386/stand/dosboot/main.c
diff -u src/sys/arch/i386/stand/dosboot/main.c:1.31 src/sys/arch/i386/stand/dosboot/main.c:1.32
--- src/sys/arch/i386/stand/dosboot/main.c:1.31	Sun Dec 25 01:09:09 2011
+++ src/sys/arch/i386/stand/dosboot/main.c	Wed Mar 26 13:58:57 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.31 2011/12/25 06:09:09 tsutsui Exp $	 */
+/*	$NetBSD: main.c,v 1.32 2014/03/26 17:58:57 christos Exp $	 */
 
 /*
  * Copyright (c) 1996, 1997
@@ -163,9 +163,9 @@ sprint_bootsel(const char *filename)
 	if (parsebootfile(filename, &fsname, &devname, &unit,
 			  &partition, &file) == 0) {
 		if (!strcmp(fsname, "dos"))
-			sprintf(buf, "dos:%s", file);
+			snprintf(buf, sizeof(buf), "dos:%s", file);
 		else if (!strcmp(fsname, "ufs"))
-			sprintf(buf, "%s%d%c:%s", devname, unit,
+			snprintf(buf, sizeof(buf), "%s%d%c:%s", devname, unit,
 				'a' + partition, file);
 		else goto bad;
 		return (buf);

Index: src/sys/arch/i386/stand/lib/test/sanamespace.h
diff -u src/sys/arch/i386/stand/lib/test/sanamespace.h:1.1 src/sys/arch/i386/stand/lib/test/sanamespace.h:1.2
--- src/sys/arch/i386/stand/lib/test/sanamespace.h:1.1	Fri May 15 13:07:16 1998
+++ src/sys/arch/i386/stand/lib/test/sanamespace.h	Wed Mar 26 13:58:57 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: sanamespace.h,v 1.1 1998/05/15 17:07:16 drochner Exp $	*/
+/*	$NetBSD: sanamespace.h,v 1.2 2014/03/26 17:58:57 christos Exp $	*/
 
 /* take back the namespace mangling done by "Makefile.satest" */
 
@@ -12,7 +12,6 @@
 #undef ioctl
 #undef lseek
 #undef printf
-#undef sprintf
 #undef vprintf
 #undef putchar
 #undef gets

Reply via email to