diff options
Diffstat (limited to 'sys/arch/sparc64/stand')
-rw-r--r-- | sys/arch/sparc64/stand/libkern/Makefile | 6 | ||||
-rw-r--r-- | sys/arch/sparc64/stand/libsa/Makefile | 4 | ||||
-rw-r--r-- | sys/arch/sparc64/stand/ofwboot/boot.c | 35 |
3 files changed, 22 insertions, 23 deletions
diff --git a/sys/arch/sparc64/stand/libkern/Makefile b/sys/arch/sparc64/stand/libkern/Makefile index d49b2a7bc58..3eb6bb9a2c8 100644 --- a/sys/arch/sparc64/stand/libkern/Makefile +++ b/sys/arch/sparc64/stand/libkern/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.4 2003/04/09 10:35:04 sturm Exp $ +# $OpenBSD: Makefile,v 1.5 2003/06/01 17:00:39 deraadt Exp $ LIB= kern @@ -16,8 +16,8 @@ AFLAGS= -x assembler-with-cpp -traditional-cpp -I${.CURDIR}/../include \ -I${.CURDIR}/../../../../lib/libkern/arch/sparc # kern routines -SRCS= __main.c ashrdi3.c bzero.S divdi3.c qdivrem.c strlen.S strcat.c \ - strcmp.c strcpy.c strlcat.c strlcpy.c strncmp.c umoddi3.c +SRCS= __main.c ashrdi3.c bzero.S divdi3.c qdivrem.c strlen.S \ + strcmp.c strlcat.c strlcpy.c strncmp.c umoddi3.c SRCS+= umul.S mul.S rem.S sdiv.S udiv.S urem.S SRCS+= saveregs.S diff --git a/sys/arch/sparc64/stand/libsa/Makefile b/sys/arch/sparc64/stand/libsa/Makefile index 4c92556a661..fd55dd6063f 100644 --- a/sys/arch/sparc64/stand/libsa/Makefile +++ b/sys/arch/sparc64/stand/libsa/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.4 2001/10/10 20:41:40 miod Exp $ +# $OpenBSD: Makefile,v 1.5 2003/06/01 17:00:40 deraadt Exp $ LIB= sa @@ -16,7 +16,7 @@ CPPFLAGS+= -D__INTERNAL_LIBSA_CREAD # stand routines SRCS= alloc.c exit.c exec.c getfile.c gets.c globals.c \ - memcmp.c memcpy.c memset.c printf.c strerror.c strncpy.c + memcmp.c memcpy.c memset.c printf.c snprintf.c strerror.c strncpy.c # io routines SRCS+= close.c closeall.c dev.c disklabel.c dkcksum.c fstat.c ioctl.c lseek.c \ diff --git a/sys/arch/sparc64/stand/ofwboot/boot.c b/sys/arch/sparc64/stand/ofwboot/boot.c index 9a2b3378256..0ab68c0218f 100644 --- a/sys/arch/sparc64/stand/ofwboot/boot.c +++ b/sys/arch/sparc64/stand/ofwboot/boot.c @@ -1,4 +1,4 @@ -/* $OpenBSD: boot.c,v 1.7 2003/05/11 20:22:20 mdw Exp $ */ +/* $OpenBSD: boot.c,v 1.8 2003/06/01 17:00:40 deraadt Exp $ */ /* $NetBSD: boot.c,v 1.3 2001/05/31 08:55:19 mrg Exp $ */ /* * Copyright (c) 1997, 1999 Eduardo E. Horvath. All rights reserved. @@ -209,7 +209,7 @@ chain(pentry, args, ssym, esym) #ifdef DEBUG printf("chain: calling OF_chain(%x, %x, %x, %x, %x)\n", - (void *)RELOC, end - (char *)RELOC, entry, args, l); + (void *)RELOC, end - (char *)RELOC, entry, args, l); #endif /* if -D is set then pause in the PROM. */ if (debug > 1) OF_enter(); @@ -248,7 +248,7 @@ loadfile(fd, args) printf("read header: %s\n", strerror(errno)); else printf("read header: short read (only %d of %d)\n", - rval, sizeof(hdr)); + rval, sizeof(hdr)); rval = 1; goto err; } @@ -263,8 +263,7 @@ loadfile(fd, args) if (bcmp(hdr.elf32.e_ident, ELFMAG, SELFMAG) == 0 && hdr.elf32.e_ident[EI_CLASS] == ELFCLASS32) { rval = elf32_exec(fd, &hdr.elf32, &entry, &ssym, &esym); - } else - if (bcmp(hdr.elf64.e_ident, ELFMAG, SELFMAG) == 0 && + } else if (bcmp(hdr.elf64.e_ident, ELFMAG, SELFMAG) == 0 && hdr.elf64.e_ident[EI_CLASS] == ELFCLASS64) { rval = elf64_exec(fd, &hdr.elf64, &entry, &ssym, &esym); } else @@ -476,8 +475,8 @@ elf32_exec(fd, elf, entryp, ssymp, esymp) for (i = 0; i < elf->e_shnum; i++, shp++) { if (shp->sh_type == SHT_NULL) continue; - if (shp->sh_type != SHT_SYMTAB - && shp->sh_type != SHT_STRTAB) { + if (shp->sh_type != SHT_SYMTAB && + shp->sh_type != SHT_STRTAB) { shp->sh_offset = 0; shp->sh_type = SHT_NOBITS; continue; @@ -511,8 +510,8 @@ elf32_exec(fd, elf, entryp, ssymp, esymp) addr += sizeof(Elf32_Ehdr) + (elf->e_shnum * sizeof(Elf32_Shdr)); off = sizeof(Elf32_Ehdr) + (elf->e_shnum * sizeof(Elf32_Shdr)); for (first = 1, i = 0; i < elf->e_shnum; i++, shp++) { - if (shp->sh_type == SHT_SYMTAB - || shp->sh_type == SHT_STRTAB) { + if (shp->sh_type == SHT_SYMTAB || + shp->sh_type == SHT_STRTAB) { if (first) printf("symbols @ 0x%lx ", (u_long)addr); printf("%s%d", first ? "" : "+", shp->sh_size); @@ -552,9 +551,9 @@ main() /* * Get the boot arguments from Openfirmware */ - if ((chosen = OF_finddevice("/chosen")) == -1 - || OF_getprop(chosen, "bootpath", bootdev, sizeof bootdev) < 0 - || OF_getprop(chosen, "bootargs", bootline, sizeof bootline) < 0) { + if ((chosen = OF_finddevice("/chosen")) == -1 || + OF_getprop(chosen, "bootpath", bootdev, sizeof bootdev) < 0 || + OF_getprop(chosen, "bootargs", bootline, sizeof bootline) < 0) { printf("Invalid Openfirmware environment\n"); exit(); } @@ -569,8 +568,8 @@ main() */ bootlp = kernels; - if (parseargs(bootline, &boothowto) == -1 - || (boothowto & RB_ASKNAME)) { + if (parseargs(bootline, &boothowto) == -1 || + (boothowto & RB_ASKNAME)) { bootlp = 0; } else if (*bootline) { just_bootline[0] = bootline; @@ -586,7 +585,7 @@ main() kernels[0] = 0; /* no more iteration */ } else if (cp != bootline) { printf(": trying %s...\n", cp); - strcpy(bootline, cp); + strlcpy(bootline, cp, sizeof bootline); } } if (!bootlp) { @@ -598,8 +597,8 @@ main() bootlp = kernels; continue; } - if (strcmp(bootline, "exit") == 0 - || strcmp(bootline, "halt") == 0) { + if (strcmp(bootline, "exit") == 0 || + strcmp(bootline, "halt") == 0) { _rtt(); } } @@ -611,7 +610,7 @@ main() OF_setprop(chosen, "bootpath", opened_name, strlen(opened_name) + 1); cp = bootline; #else - strcpy(bootline, opened_name); + strlcpy(bootline, opened_name, sizeof bootline); cp = bootline + strlen(bootline); *cp++ = ' '; #endif |