Changeset 3789
- Timestamp:
- 12/02/08 13:26:17 (5 weeks ago)
- Files:
-
- 1 modified
-
trunk/coreboot-v2/util/options/build_opt_tbl.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/coreboot-v2/util/options/build_opt_tbl.c
r3783 r3789 5 5 #include <ctype.h> 6 6 #include <errno.h> 7 #include <libgen.h> 7 8 #include "../../src/include/pc80/mc146818rtc.h" 8 9 #include "../../src/include/boot/coreboot_tables.h" … … 12 13 #define MAX_VALUE_BYTE_LENGTH 64 13 14 14 #define TMPFILE_TEMPLATE "/tmp/build_opt_tbl_XXXXXX" 15 #define TMPFILE_LEN 256 16 #define TMPFILE_TEMPLATE "/build_opt_tbl_XXXXXX" 15 17 16 18 static unsigned char cmos_table[4096]; … … 216 218 FILE *fp; 217 219 int tmpfile; 218 char tmpfilename[ 32];220 char tmpfilename[TMPFILE_LEN]; 219 221 struct cmos_option_table *ct; 220 222 struct cmos_entries *ce; … … 486 488 /* See if we want to output a C source file */ 487 489 if(option) { 488 strcpy(tmpfilename, TMPFILE_TEMPLATE); 490 strncpy(tmpfilename, dirname(option), TMPFILE_LEN); 491 strncat(tmpfilename, TMPFILE_TEMPLATE, TMPFILE_LEN); 489 492 tmpfile = mkstemp(tmpfilename); 490 493 if(tmpfile == -1) { … … 536 539 struct lb_record *ptr, *end; 537 540 538 strcpy(tmpfilename, TMPFILE_TEMPLATE); 541 strncpy(tmpfilename, dirname(option), TMPFILE_LEN); 542 strncat(tmpfilename, TMPFILE_TEMPLATE, TMPFILE_LEN); 539 543 tmpfile = mkstemp(tmpfilename); 540 544 if(tmpfile == -1) {
