From f481c0f6cfbc6dbb9e3d1e78b5684f035e0f8fe7 Mon Sep 17 00:00:00 2001 From: Stefan Reinauer Date: Fri, 29 Jun 2007 22:15:24 +0000 Subject: [PATCH] fix lar code to return 1 when the file is not found. (trivial) Signed-off-by: Stefan Reinauer Acked-by: Stefan Reinauer git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@421 f3766cd6-281f-0410-b1cd-43a5c92072e9 --- arch/x86/stage1.c | 2 +- lib/lar.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/stage1.c b/arch/x86/stage1.c index d61721b7fb..3265741c72 100644 --- a/arch/x86/stage1.c +++ b/arch/x86/stage1.c @@ -101,7 +101,7 @@ void stage1_main(u32 bist) // FIXME this should be defined in the VPD area // but NOT IN THE CODE. - archive.len=(CONFIG_LINUXBIOS_ROMSIZE_KB-16)*1024; + archive.len=(CONFIG_LINUXBIOS_ROMSIZE_KB)*1024; archive.start=(void *)(0UL-(CONFIG_LINUXBIOS_ROMSIZE_KB*1024)); // FIXME check integrity diff --git a/lib/lar.c b/lib/lar.c index 6fedc4111e..108482b6ad 100644 --- a/lib/lar.c +++ b/lib/lar.c @@ -40,7 +40,7 @@ int find_file(struct mem_file *archive, char *filename, struct mem_file *result) archive->len); for (walk = archive->start; - walk < (char *)archive->start + archive->len - 1; walk += 16) { + (walk - 1) < (char *)(archive->start + archive->len - 1 ); walk += 16) { if (strcmp(walk, MAGIC) != 0) continue;