From 73a83c1f1726639d1e5d4eaa8b56e5a9a46879cf Mon Sep 17 00:00:00 2001 From: Carl-Daniel Hailfinger Date: Tue, 4 Dec 2007 23:15:33 +0000 Subject: [PATCH] Change wrong "LAR: NO FILE FOUND!" message to "LAR: File not found!". The message appears if a file has not been found in the LAR archive and is triggered even by lookup routines. Normal capitalization helps reducing the frightening effect of the message. Correct a few typos in other areas of the LAR code as well. Signed-off-by: Carl-Daniel Hailfinger Acked-by: Carl-Daniel Hailfinger git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@538 f3766cd6-281f-0410-b1cd-43a5c92072e9 --- lib/lar.c | 2 +- util/lar/stream.c | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/lib/lar.c b/lib/lar.c index 98e5ce9ed5..9051f62959 100644 --- a/lib/lar.c +++ b/lib/lar.c @@ -141,7 +141,7 @@ int find_file(const struct mem_file *archive, const char *filename, struct mem_f walk += (ntohl(header->offset) + ntohl(header->len) - 1) & 0xfffffff0; } - printk(BIOS_SPEW, "LAR: NO FILE FOUND!\n"); + printk(BIOS_SPEW, "LAR: File not found!\n"); return 1; } diff --git a/util/lar/stream.c b/util/lar/stream.c index 86d1740e54..93611d5846 100644 --- a/util/lar/stream.c +++ b/util/lar/stream.c @@ -63,7 +63,7 @@ int iself(char *filebuf) /** * Output all the ELF segments for a given file - * @param lar The LAR Archoe + * @param lar The LAR archive * @param name The LAR name * @param filebuf The ELF file * @param filelen Size of the ELF file @@ -88,9 +88,13 @@ int output_elf_segments(struct lar *lar, char *name, char *filebuf, u32 complen; /* Allocate a temporary buffer to compress into - this is unavoidable, - because we need to make sure that the compressed data will fit in - the LAR, and we won't know the size of the compressed data until - we actually compress it */ + * because we need to make sure that the compressed data will fit in + * the LAR, and we won't know the size of the compressed data until + * we actually compress it. + * FIXME: In case the compressed file is bigger than the original, + * we corrupt memory. Compute maximum size increase and allocate that + * on top of the file length. + */ temp = calloc(filelen, 1);