diff options
author | Hakan Olsson <ho@cvs.openbsd.org> | 2003-04-06 18:54:21 +0000 |
---|---|---|
committer | Hakan Olsson <ho@cvs.openbsd.org> | 2003-04-06 18:54:21 +0000 |
commit | 51ab7e02d9e6e7c9950f34bc0cc7cc72bb53bd12 (patch) | |
tree | 749f8097655f1aa27f2d7a4a1ecdad5e155781a5 /sys/arch/sparc64/stand | |
parent | 0f64621783b3f46a4851826b9f4284e3c9dbeb61 (diff) |
strcat/strcpy/sprintf cleanup. krw@, anil@ ok. art@ tested sparc64.
Diffstat (limited to 'sys/arch/sparc64/stand')
-rw-r--r-- | sys/arch/sparc64/stand/ofwboot/ofdev.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/sys/arch/sparc64/stand/ofwboot/ofdev.c b/sys/arch/sparc64/stand/ofwboot/ofdev.c index 16f91db8f87..3edf4c6cbef 100644 --- a/sys/arch/sparc64/stand/ofwboot/ofdev.c +++ b/sys/arch/sparc64/stand/ofwboot/ofdev.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ofdev.c,v 1.4 2002/07/10 20:30:15 jsyn Exp $ */ +/* $OpenBSD: ofdev.c,v 1.5 2003/04/06 18:54:20 ho Exp $ */ /* $NetBSD: ofdev.c,v 1.1 2000/08/20 14:58:41 mrg Exp $ */ /* @@ -400,17 +400,17 @@ devopen(of, name, file) #ifdef NOTDEF_DEBUG printf("devopen: you want %s\n", name); #endif - strcpy(fname, name); + strlcpy(fname, name, sizeof fname); cp = filename(fname, &partition); if (cp) { - strcpy(buf, cp); + strlcpy(buf, cp, sizeof buf); *cp = 0; } if (!cp || !*buf) - strcpy(buf, DEFAULT_KERNEL); + strlcpy(buf, DEFAULT_KERNEL, sizeof buf); if (!*fname) - strcpy(fname, bootdev); - strcpy(opened_name, fname); + strlcpy(fname, bootdev, sizeof fname); + strlcpy(opened_name, fname, sizeof opened_name); if (partition) { cp = opened_name + strlen(opened_name); *cp++ = ':'; @@ -418,8 +418,8 @@ devopen(of, name, file) *cp = 0; } if (*buf != '/') - strcat(opened_name, "/"); - strcat(opened_name, buf); + strlcat(opened_name, "/", sizeof opened_name); + strlcat(opened_name, buf, sizeof opened_name); *file = opened_name + strlen(fname) + 1; #ifdef NOTDEF_DEBUG printf("devopen: trying %s\n", fname); |