Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/i386/stand kill sprintf.



details:   https://anonhg.NetBSD.org/src/rev/942d477ad709
branches:  trunk
changeset: 794855:942d477ad709
user:      christos <christos%NetBSD.org@localhost>
date:      Wed Mar 26 17:58:57 2014 +0000

description:
kill sprintf.

diffstat:

 sys/arch/i386/stand/boot/boot2.c           |  5 +++--
 sys/arch/i386/stand/dosboot/main.c         |  6 +++---
 sys/arch/i386/stand/lib/test/sanamespace.h |  3 +--
 3 files changed, 7 insertions(+), 7 deletions(-)

diffs (57 lines):

diff -r 65ba394261ee -r 942d477ad709 sys/arch/i386/stand/boot/boot2.c
--- a/sys/arch/i386/stand/boot/boot2.c  Wed Mar 26 17:54:46 2014 +0000
+++ b/sys/arch/i386/stand/boot/boot2.c  Wed Mar 26 17:58:57 2014 +0000
@@ -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 @@
 
        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)";
diff -r 65ba394261ee -r 942d477ad709 sys/arch/i386/stand/dosboot/main.c
--- a/sys/arch/i386/stand/dosboot/main.c        Wed Mar 26 17:54:46 2014 +0000
+++ b/sys/arch/i386/stand/dosboot/main.c        Wed Mar 26 17:58:57 2014 +0000
@@ -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 @@
        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);
diff -r 65ba394261ee -r 942d477ad709 sys/arch/i386/stand/lib/test/sanamespace.h
--- a/sys/arch/i386/stand/lib/test/sanamespace.h        Wed Mar 26 17:54:46 2014 +0000
+++ b/sys/arch/i386/stand/lib/test/sanamespace.h        Wed Mar 26 17:58:57 2014 +0000
@@ -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



Home | Main Index | Thread Index | Old Index