summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorPatrick Georgi <patrick.georgi@secunet.com>2011-01-18 14:38:59 +0000
committerPatrick Georgi <patrick.georgi@coresystems.de>2011-01-18 14:38:59 +0000
commit3ad0851d79c0046bdcd2d56c4f9889c5fa4f0913 (patch)
tree1f2ae76fc2b4f25a917c7fd846aec7fdadcb5f16 /util
parentcef3b896c1593de5a41b57bff4d4600d0c90e06e (diff)
downloadcoreboot-3ad0851d79c0046bdcd2d56c4f9889c5fa4f0913.tar.xz
Fix fwrite tests.
Signed-off-by: Patrick Georgi <patrick.georgi@secunet.com> Acked-by: Patrick Georgi <patrick.georgi@secunet.com> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@6270 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'util')
-rw-r--r--util/options/build_opt_tbl.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/util/options/build_opt_tbl.c b/util/options/build_opt_tbl.c
index 0b25b0c194..cbba80dcb7 100644
--- a/util/options/build_opt_tbl.c
+++ b/util/options/build_opt_tbl.c
@@ -541,7 +541,7 @@ int main(int argc, char **argv)
}
/* write the header */
- if(!fwrite("unsigned char option_table[] = {",1,32,fp)) {
+ if(fwrite("unsigned char option_table[] = {",1,32,fp) != 32) {
perror("Error - Could not write image file");
fclose(fp);
unlink(tempfilename);
@@ -549,14 +549,14 @@ int main(int argc, char **argv)
}
/* write the array values */
for(i=0; i<(int)(ct->size-1); i++) {
- if(!(i%10) && !err) err=!fwrite("\n\t",1,2,fp);
+ if(!(i%10) && !err) err=(fwrite("\n\t",1,2,fp) != 2);
sprintf(buf,"0x%02x,",cmos_table[i]);
- if(!err) err=!fwrite(buf,1,5,fp);
+ if(!err) err=(fwrite(buf,1,5,fp) != 5);
}
/* write the end */
sprintf(buf,"0x%02x\n",cmos_table[i]);
- if(!err) err=!fwrite(buf,1,4,fp);
- if(!fwrite("};\n",1,3,fp)) {
+ if(!err) err=(fwrite(buf,1,4,fp) != 4);
+ if(fwrite("};\n",1,3,fp) != 3) {
perror("Error - Could not write image file");
fclose(fp);
unlink(tempfilename);
@@ -590,7 +590,7 @@ int main(int argc, char **argv)
}
/* write the array values */
- if(!fwrite(cmos_table, (int)(ct->size-1), 1, fp)) {
+ if(fwrite(cmos_table, (int)(ct->size-1), 1, fp) != 1) {
perror("Error - Could not write image file");
fclose(fp);
unlink(tempfilename);