diff options
author | Michael Shalayeff <mickey@cvs.openbsd.org> | 2002-11-11 00:04:31 +0000 |
---|---|---|
committer | Michael Shalayeff <mickey@cvs.openbsd.org> | 2002-11-11 00:04:31 +0000 |
commit | 04ff84db572e5296106b8aa93fd109244abca341 (patch) | |
tree | b5343ac96a0a7975a259308e1334b0d6547ac25f /sys/lib/libsa | |
parent | 1b537b84e7966ba9758128dc30c4586845846038 (diff) |
avoid uninitialized warnings from gcc; art@ ok
Diffstat (limited to 'sys/lib/libsa')
-rw-r--r-- | sys/lib/libsa/loadfile.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/sys/lib/libsa/loadfile.c b/sys/lib/libsa/loadfile.c index 10d36bbbb54..16918f929bb 100644 --- a/sys/lib/libsa/loadfile.c +++ b/sys/lib/libsa/loadfile.c @@ -1,5 +1,5 @@ /* $NetBSD: loadfile.c,v 1.10 2000/12/03 02:53:04 tsutsui Exp $ */ -/* $OpenBSD: loadfile.c,v 1.2 2002/03/14 01:27:07 millert Exp $ */ +/* $OpenBSD: loadfile.c,v 1.3 2002/11/11 00:04:30 mickey Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -279,7 +279,7 @@ elf_exec(fd, elf, marks, flags) size_t sz; int first; int havesyms; - paddr_t minp = ~0, maxp = 0, pos; + paddr_t minp = ~0, maxp = 0, pos = 0; paddr_t offset = marks[MARK_START], shpp, elfp; for (first = 1, i = 0; i < elf->e_phnum; i++) { @@ -349,11 +349,9 @@ elf_exec(fd, elf, marks, flags) /* * Copy the ELF and section headers. */ - maxp = roundup(maxp, sizeof(long)); - if (flags & (LOAD_HDR|COUNT_HDR)) { - elfp = maxp; + elfp = maxp = roundup(maxp, sizeof(long)); + if (flags & (LOAD_HDR|COUNT_HDR)) maxp += sizeof(Elf_Ehdr); - } if (flags & (LOAD_SYM|COUNT_SYM)) { if (lseek(fd, elf->e_shoff, SEEK_SET) == -1) { |