Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/sandpoint/stand/altboot Don't use non-literal strin...
details: https://anonhg.NetBSD.org/src/rev/85d8d5463b77
branches: trunk
changeset: 331216:85d8d5463b77
user: joerg <joerg%NetBSD.org@localhost>
date: Tue Aug 05 17:55:20 2014 +0000
description:
Don't use non-literal strings as format strings.
XXX Switch to strlcpy.
diffstat:
sys/arch/sandpoint/stand/altboot/brdsetup.c | 6 +++---
sys/arch/sandpoint/stand/altboot/dev_net.c | 6 +++---
sys/arch/sandpoint/stand/altboot/dsk.c | 4 ++--
sys/arch/sandpoint/stand/altboot/main.c | 4 ++--
sys/arch/sandpoint/stand/altboot/nif.c | 6 +++---
5 files changed, 13 insertions(+), 13 deletions(-)
diffs (108 lines):
diff -r 3f2cb746b460 -r 85d8d5463b77 sys/arch/sandpoint/stand/altboot/brdsetup.c
--- a/sys/arch/sandpoint/stand/altboot/brdsetup.c Tue Aug 05 17:39:07 2014 +0000
+++ b/sys/arch/sandpoint/stand/altboot/brdsetup.c Tue Aug 05 17:55:20 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: brdsetup.c,v 1.33 2013/11/07 14:51:36 nisimura Exp $ */
+/* $NetBSD: brdsetup.c,v 1.34 2014/08/05 17:55:20 joerg Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -319,11 +319,11 @@
brdfixup();
bi_mem.memsize = mpc107memsize();
- snprintf(bi_cons.devname, sizeof(bi_cons.devname), consname);
+ snprintf(bi_cons.devname, sizeof(bi_cons.devname), "%s", consname);
bi_cons.addr = consport;
bi_cons.speed = brdprop->consspeed;
bi_clk.ticks_per_sec = ticks_per_sec;
- snprintf(bi_fam.name, sizeof(bi_fam.name), brdprop->family);
+ snprintf(bi_fam.name, sizeof(bi_fam.name), "%s", brdprop->family);
}
struct brdprop *
diff -r 3f2cb746b460 -r 85d8d5463b77 sys/arch/sandpoint/stand/altboot/dev_net.c
--- a/sys/arch/sandpoint/stand/altboot/dev_net.c Tue Aug 05 17:39:07 2014 +0000
+++ b/sys/arch/sandpoint/stand/altboot/dev_net.c Tue Aug 05 17:55:20 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dev_net.c,v 1.2 2011/07/17 20:54:46 joerg Exp $ */
+/* $NetBSD: dev_net.c,v 1.3 2014/08/05 17:55:20 joerg Exp $ */
/*-
* Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -75,7 +75,7 @@
}
if (file[0] != '\0')
- snprintf(bootfile, sizeof(bootfile), file);
+ snprintf(bootfile, sizeof(bootfile), "%s", file);
else if (bootfile[0] == '\0')
snprintf(bootfile, sizeof(bootfile), "netbsd");
@@ -83,7 +83,7 @@
&& (error = nfs_mount(netdev_sock, rootip, rootpath)) != 0)
goto bad;
- snprintf(bi_path.bootpath, sizeof(bi_path.bootpath), bootfile);
+ snprintf(bi_path.bootpath, sizeof(bi_path.bootpath), "%s", bootfile);
f->f_devdata = &netdev_sock;
netdev_opens++;
return 0;
diff -r 3f2cb746b460 -r 85d8d5463b77 sys/arch/sandpoint/stand/altboot/dsk.c
--- a/sys/arch/sandpoint/stand/altboot/dsk.c Tue Aug 05 17:39:07 2014 +0000
+++ b/sys/arch/sandpoint/stand/altboot/dsk.c Tue Aug 05 17:55:20 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dsk.c,v 1.16 2012/04/26 19:59:37 phx Exp $ */
+/* $NetBSD: dsk.c,v 1.17 2014/08/05 17:55:20 joerg Exp $ */
/*-
* Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -502,7 +502,7 @@
d->part = part;
f->f_devdata = d;
- snprintf(bi_path.bootpath, sizeof(bi_path.bootpath), name);
+ snprintf(bi_path.bootpath, sizeof(bi_path.bootpath), "%s", name);
if (dlp->d_partitions[part].p_fstype == FS_BSDFFS) {
if ((error = ffsv2_open(name, f)) == 0) {
fs = &fs_ffsv2;
diff -r 3f2cb746b460 -r 85d8d5463b77 sys/arch/sandpoint/stand/altboot/main.c
--- a/sys/arch/sandpoint/stand/altboot/main.c Tue Aug 05 17:39:07 2014 +0000
+++ b/sys/arch/sandpoint/stand/altboot/main.c Tue Aug 05 17:55:20 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.25 2014/03/26 17:35:08 christos Exp $ */
+/* $NetBSD: main.c,v 1.26 2014/08/05 17:55:20 joerg Exp $ */
/*-
* Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -525,7 +525,7 @@
if (size < bm->bm_len)
printf("WARNING: couldn't load");
else {
- snprintf(bi->kmod, sizeof(bi->kmod), bm->bm_kmod);
+ snprintf(bi->kmod, sizeof(bi->kmod), "%s", bm->bm_kmod);
bi->type = BI_MODULE_ELF;
bi->len = size;
bi->base = kmodloadp;
diff -r 3f2cb746b460 -r 85d8d5463b77 sys/arch/sandpoint/stand/altboot/nif.c
--- a/sys/arch/sandpoint/stand/altboot/nif.c Tue Aug 05 17:39:07 2014 +0000
+++ b/sys/arch/sandpoint/stand/altboot/nif.c Tue Aug 05 17:55:20 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: nif.c,v 1.5 2011/03/12 16:41:23 phx Exp $ */
+/* $NetBSD: nif.c,v 1.6 2014/08/05 17:55:20 joerg Exp $ */
/*-
* Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -88,10 +88,10 @@
s->io_netif = dv;
memcpy(s->myea, enaddr, sizeof(s->myea));
/* build btinfo to identify NIF device */
- snprintf(bi_net.devname, sizeof(bi_net.devname), dv->name);
+ snprintf(bi_net.devname, sizeof(bi_net.devname), "%s", dv->name);
memcpy(bi_net.mac_address, enaddr, sizeof(bi_net.mac_address));
bi_net.cookie = tag;
- snprintf(bi_rdev.devname, sizeof(bi_rdev.devname), dv->name);
+ snprintf(bi_rdev.devname, sizeof(bi_rdev.devname), "%s", dv->name);
bi_rdev.cookie = tag;
return 1;
}
Home |
Main Index |
Thread Index |
Old Index