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:
Ronald G. Minnich 2008-08-21 15:49:29 +00:00
parent f7da69c7a9
commit 4bb450cfa3

View file

@ -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);