diff options
author | Robert Moore <Robert.Moore@intel.com> | 2012-10-25 08:50:57 -0700 |
---|---|---|
committer | Robert Moore <Robert.Moore@intel.com> | 2012-10-25 08:50:57 -0700 |
commit | 33c99ff24b9c8712be96e96d4d82f34f72070bd1 (patch) | |
tree | 590318a827dcf6b61d5471c127a7403b957068ea | |
parent | 49dec9f2b8e8f0b15f787544731fe34173de8c38 (diff) | |
download | acpica-33c99ff24b9c8712be96e96d4d82f34f72070bd1.tar.gz |
iASL: Add check for return value from fwrite().
Ensure that the fwrite did not fail.
-rw-r--r-- | source/compiler/aslerror.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/source/compiler/aslerror.c b/source/compiler/aslerror.c index 6c8d51eb8..d4b61668f 100644 --- a/source/compiler/aslerror.c +++ b/source/compiler/aslerror.c @@ -376,7 +376,12 @@ AePrintException ( { while (RActual && SourceByte && (SourceByte != '\n') && (Total < 256)) { - fwrite (&SourceByte, 1, 1, OutputFile); + if (fwrite (&SourceByte, 1, 1, OutputFile) != 1) + { + printf ("[*** iASL: Write error on output file ***]\n"); + return; + } + RActual = fread (&SourceByte, 1, 1, SourceFile); Total++; } |