From f107538e33c880cb52ee131a527149cce9f936ee Mon Sep 17 00:00:00 2001 From: Patrick Georgi Date: Sat, 18 Jul 2009 14:20:39 +0000 Subject: strdup the input of dirname, as dirname is free (according to the spec) to change the string in-situ, even if glibc doesn't do it. This avoids errors on Mac OS and Solaris. Kill nrv2b support in CBFS (we have lzma), slightly improve debug output in CBFS, properly declare all functions of CBFS in the header. Signed-off-by: Patrick Georgi Acked-by: Uwe Hermann git-svn-id: svn://svn.coreboot.org/coreboot/trunk@4436 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1 --- util/options/build_opt_tbl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'util/options') diff --git a/util/options/build_opt_tbl.c b/util/options/build_opt_tbl.c index f4aa8af..ec94006 100644 --- a/util/options/build_opt_tbl.c +++ b/util/options/build_opt_tbl.c @@ -488,7 +488,7 @@ int main(int argc, char **argv) /* See if we want to output a C source file */ if(option) { int err=0; - strncpy(tmpfilename, dirname(option), TMPFILE_LEN); + strncpy(tmpfilename, dirname(strdup(option)), TMPFILE_LEN); strncat(tmpfilename, TMPFILE_TEMPLATE, TMPFILE_LEN); tmpfile = mkstemp(tmpfilename); if(tmpfile == -1) { @@ -539,7 +539,7 @@ int main(int argc, char **argv) struct cmos_option_table *hdr; struct lb_record *ptr, *end; - strncpy(tmpfilename, dirname(option), TMPFILE_LEN); + strncpy(tmpfilename, dirname(strdup(option)), TMPFILE_LEN); strncat(tmpfilename, TMPFILE_TEMPLATE, TMPFILE_LEN); tmpfile = mkstemp(tmpfilename); if(tmpfile == -1) { -- cgit v1.1