diff options
author | 2002-11-11 00:04:30 +0000 | |
---|---|---|
committer | 2002-11-11 00:04:30 +0000 | |
commit | f19e6e8c6d276258784d73fea19d95a2b94ebb36 (patch) | |
tree | 6485caaf62802cef44c55f05c3b4cc1a3a6ad567 /sys | |
parent | hppa is not a special case anymore (diff) | |
download | wireguard-openbsd-f19e6e8c6d276258784d73fea19d95a2b94ebb36.tar.xz wireguard-openbsd-f19e6e8c6d276258784d73fea19d95a2b94ebb36.zip |
avoid uninitialized warnings from gcc; art@ ok
Diffstat (limited to 'sys')
-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) { |