mirror of
https://github.com/fail0verflow/switch-coreboot.git
synced 2025-05-04 01:39:18 -04:00
Emergency patch so that section checker won't bounce option tables.
Also gets rid of hard-codes in fwrite for strings that might, in future, vary. Signed-off-by: Ronald G. Minnich <rminnich@gmail.com> Acked-by: Ronald G. Minnich <rminnich@gmail.com> git-svn-id: svn://coreboot.org/repository/coreboot-v3@791 f3766cd6-281f-0410-b1cd-43a5c92072e9
This commit is contained in:
parent
f7da69c7a9
commit
4bb450cfa3
1 changed files with 4 additions and 3 deletions
|
@ -237,7 +237,8 @@ int main(int argc, char **argv)
|
|||
int enum_length;
|
||||
int len;
|
||||
char buf[16];
|
||||
|
||||
char *preamble = "const unsigned char option_table[] = {";
|
||||
char *postamble = "};\n";
|
||||
for(i=1;i<argc;i++) {
|
||||
if(argv[i][0]!='-') {
|
||||
display_usage();
|
||||
|
@ -503,7 +504,7 @@ int main(int argc, char **argv)
|
|||
}
|
||||
}
|
||||
/* write the header */
|
||||
if(!fwrite("unsigned char option_table[] = {",1,32,fp)) {
|
||||
if(!fwrite(preamble,1,strlen(preamble),fp)) {
|
||||
fprintf(stderr, "Error - Could not write image file\n");
|
||||
fclose(fp);
|
||||
exit(1);
|
||||
|
@ -517,7 +518,7 @@ int main(int argc, char **argv)
|
|||
/* write the end */
|
||||
sprintf(buf,"0x%02x",cmos_table[i]);
|
||||
fwrite(buf,1,4,fp);
|
||||
if(!fwrite("};\n",1,3,fp)) {
|
||||
if(!fwrite(postamble,1,strlen(postamble),fp)) {
|
||||
fprintf(stderr, "Error - Could not write image file\n");
|
||||
fclose(fp);
|
||||
exit(1);
|
||||
|
|
Loading…
Add table
Reference in a new issue