Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys kill sprintf
details: https://anonhg.NetBSD.org/src/rev/3af097e6597c
branches: trunk
changeset: 327913:3af097e6597c
user: christos <christos%NetBSD.org@localhost>
date: Thu Mar 20 20:51:40 2014 +0000
description:
kill sprintf
diffstat:
sys/altq/altq_afmap.c | 7 ++++---
sys/altq/altq_cbq.c | 7 ++++---
sys/altq/altq_wfq.c | 7 ++++---
sys/arch/alpha/alpha/db_disasm.c | 20 ++++++++++----------
sys/arch/alpha/alpha/machdep.c | 6 +++---
sys/arch/alpha/alpha/trap.c | 6 +++---
6 files changed, 28 insertions(+), 25 deletions(-)
diffs (228 lines):
diff -r d8f7b4c75d05 -r 3af097e6597c sys/altq/altq_afmap.c
--- a/sys/altq/altq_afmap.c Thu Mar 20 20:45:32 2014 +0000
+++ b/sys/altq/altq_afmap.c Thu Mar 20 20:51:40 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: altq_afmap.c,v 1.19 2008/11/07 00:20:01 dyoung Exp $ */
+/* $NetBSD: altq_afmap.c,v 1.20 2014/03/20 20:51:54 christos Exp $ */
/* $KAME: altq_afmap.c,v 1.12 2005/04/13 03:44:24 suz Exp $ */
/*
@@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: altq_afmap.c,v 1.19 2008/11/07 00:20:01 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: altq_afmap.c,v 1.20 2014/03/20 20:51:54 christos Exp $");
#ifdef _KERNEL_OPT
#include "opt_altq.h"
@@ -334,7 +334,8 @@
head = head->afh_chain.le_next) {
/* call interface to clean up maps */
- sprintf(fmap.af_ifname, "%s", head->afh_ifp->if_xname);
+ snprintf(fmap.af_ifname, sizeof(fmap.af_ifname),
+ "%s", head->afh_ifp->if_xname);
err = afmioctl(dev, AFM_CLEANFMAP, (void *)&fmap, flag, l);
if (err && error == 0)
error = err;
diff -r d8f7b4c75d05 -r 3af097e6597c sys/altq/altq_cbq.c
--- a/sys/altq/altq_cbq.c Thu Mar 20 20:45:32 2014 +0000
+++ b/sys/altq/altq_cbq.c Thu Mar 20 20:51:40 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: altq_cbq.c,v 1.26 2009/11/22 18:40:26 mbalmer Exp $ */
+/* $NetBSD: altq_cbq.c,v 1.27 2014/03/20 20:51:54 christos Exp $ */
/* $KAME: altq_cbq.c,v 1.21 2005/04/13 03:44:24 suz Exp $ */
/*
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: altq_cbq.c,v 1.26 2009/11/22 18:40:26 mbalmer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: altq_cbq.c,v 1.27 2014/03/20 20:51:54 christos Exp $");
#ifdef _KERNEL_OPT
#include "opt_altq.h"
@@ -990,7 +990,8 @@
while (cbq_list) {
ifp = cbq_list->ifnp.ifq_->altq_ifp;
- sprintf(iface.cbq_ifacename, "%s", ifp->if_xname);
+ snprintf(iface.cbq_ifacename, sizeof(iface.cbq_ifacename),
+ "%s", ifp->if_xname);
err = cbq_ifdetach(&iface);
if (err != 0 && error == 0)
error = err;
diff -r d8f7b4c75d05 -r 3af097e6597c sys/altq/altq_wfq.c
--- a/sys/altq/altq_wfq.c Thu Mar 20 20:45:32 2014 +0000
+++ b/sys/altq/altq_wfq.c Thu Mar 20 20:51:40 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: altq_wfq.c,v 1.19 2008/09/11 17:58:59 joerg Exp $ */
+/* $NetBSD: altq_wfq.c,v 1.20 2014/03/20 20:51:54 christos Exp $ */
/* $KAME: altq_wfq.c,v 1.14 2005/04/13 03:44:25 suz Exp $ */
/*
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: altq_wfq.c,v 1.19 2008/09/11 17:58:59 joerg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: altq_wfq.c,v 1.20 2014/03/20 20:51:54 christos Exp $");
#ifdef _KERNEL_OPT
#include "opt_altq.h"
@@ -658,7 +658,8 @@
s = splnet();
while ((wfqp = wfq_list) != NULL) {
ifp = wfqp->ifq->altq_ifp;
- sprintf(iface.wfq_ifacename, "%s", ifp->if_xname);
+ snprintf(iface.wfq_ifacename, sizeof(iface.wfq_ifacename),
+ "%s", ifp->if_xname);
wfq_ifdetach(&iface);
}
splx(s);
diff -r d8f7b4c75d05 -r 3af097e6597c sys/arch/alpha/alpha/db_disasm.c
--- a/sys/arch/alpha/alpha/db_disasm.c Thu Mar 20 20:45:32 2014 +0000
+++ b/sys/arch/alpha/alpha/db_disasm.c Thu Mar 20 20:51:40 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: db_disasm.c,v 1.15 2012/02/06 02:14:10 matt Exp $ */
+/* $NetBSD: db_disasm.c,v 1.16 2014/03/20 20:51:40 christos Exp $ */
/*
* Mach Operating System
@@ -48,7 +48,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: db_disasm.c,v 1.15 2012/02/06 02:14:10 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_disasm.c,v 1.16 2014/03/20 20:51:40 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -199,7 +199,7 @@
return (pal_op_tbl[i].name);
}
- sprintf(unk, "0x%x", op);
+ snprintf(unk, sizeof(unk), "0x%x", op);
return (unk);
}
@@ -253,7 +253,7 @@
if (name != NULL)
return (name);
- sprintf(unk, "?arit 0x%x?", op);
+ snprintf(unk, sizeof(unk), "?arit 0x%x?", op);
return (unk);
}
@@ -301,7 +301,7 @@
if (name != NULL)
return (name);
- sprintf(unk, "?logical 0x%x?", op);
+ snprintf(unk, sizeof(unk), "?logical 0x%x?", op);
return (unk);
}
@@ -344,7 +344,7 @@
if (name != NULL)
return (name);
- sprintf(unk, "?bit 0x%x?", op);
+ snprintf(unk, sizeof(unk), "?bit 0x%x?", op);
return (unk);
}
@@ -366,7 +366,7 @@
if (name != NULL)
return (name);
- sprintf(unk, "?mul 0x%x?", op);
+ snprintf(unk, sizeof(unk), "?mul 0x%x?", op);
return (unk);
}
@@ -398,7 +398,7 @@
if (name != NULL)
return (name);
- sprintf(unk, "?special 0x%x?", op);
+ snprintf(unk, sizeof(unk), "?special 0x%x?", op);
return (unk);
}
@@ -435,7 +435,7 @@
case op_ftois: return ("ftois");
}
- sprintf(unk, "?intmisc 0x%x?", op);
+ snprintf(unk, sizeof(unk), "?intmisc 0x%x?", op);
return (unk);
}
@@ -450,7 +450,7 @@
return (tbl[i].name);
}
- sprintf(unk, "?%s 0x%x?", type, op);
+ snprintf(unk, sizeof(unk), "?%s 0x%x?", type, op);
return (unk);
}
diff -r d8f7b4c75d05 -r 3af097e6597c sys/arch/alpha/alpha/machdep.c
--- a/sys/arch/alpha/alpha/machdep.c Thu Mar 20 20:45:32 2014 +0000
+++ b/sys/arch/alpha/alpha/machdep.c Thu Mar 20 20:51:40 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.342 2012/09/12 02:00:53 manu Exp $ */
+/* $NetBSD: machdep.c,v 1.343 2014/03/20 20:51:40 christos Exp $ */
/*-
* Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.342 2012/09/12 02:00:53 manu Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.343 2014/03/20 20:51:40 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -928,7 +928,7 @@
{
static char s[128]; /* safe size */
- sprintf(s, "%s family, unknown model variation 0x%lx",
+ snprintf(s, sizeof(s), "%s family, unknown model variation 0x%lx",
platform.family, hwrpb->rpb_variation & SV_ST_MASK);
return ((const char *)s);
}
diff -r d8f7b4c75d05 -r 3af097e6597c sys/arch/alpha/alpha/trap.c
--- a/sys/arch/alpha/alpha/trap.c Thu Mar 20 20:45:32 2014 +0000
+++ b/sys/arch/alpha/alpha/trap.c Thu Mar 20 20:51:40 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: trap.c,v 1.129 2013/11/04 16:57:32 christos Exp $ */
+/* $NetBSD: trap.c,v 1.130 2014/03/20 20:51:40 christos Exp $ */
/*-
* Copyright (c) 2000, 2001 The NetBSD Foundation, Inc.
@@ -93,7 +93,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.129 2013/11/04 16:57:32 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.130 2014/03/20 20:51:40 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -174,7 +174,7 @@
entryname = "system call";
break;
default:
- sprintf(ubuf, "type %lx", entry);
+ snprintf(ubuf, sizeof(ubuf), "type %lx", entry);
entryname = (const char *) ubuf;
break;
}
Home |
Main Index |
Thread Index |
Old Index