Chromium Code Reviews| Index: data_layout.c |
| diff --git a/data_layout.c b/data_layout.c |
| index 3c49f9f20b7d98b4b3277bd8f92726c4792bebf9..1e38b0ff6cd7cc835dd3c90e3710363ac98a0526 100644 |
| --- a/data_layout.c |
| +++ b/data_layout.c |
| @@ -1017,9 +1017,12 @@ write_block_raw(build_image_context *context) |
| data = empty_blk; |
| } |
| /* Write the data */ |
| - fwrite(data, 1, |
| - pages_to_write * context->page_size, |
| - context->raw_file); |
| + { |
|
Micah C
2011/02/08 03:52:46
What is the need for this extra indentation and en
robotboy
2011/02/08 18:48:00
ANSI C doesn't allow for the declaration of a vari
|
| + size_t bytes = pages_to_write * context->page_size; |
|
Micah C
2011/02/08 03:52:46
The \t after size_t bytes might be replaceable wit
robotboy
2011/02/08 18:48:00
Done.
|
| + |
| + if (fwrite(data, 1, bytes, context->raw_file) != bytes) |
| + return -1; |
|
Micah C
2011/02/08 03:52:46
Another error exit from this function returns a ne
robotboy
2011/02/08 18:48:00
I believe that the correct thing to do is check bo
|
| + } |
| } |
| free(empty_blk); |