aboutsummaryrefslogtreecommitdiff
path: root/source/compiler/aslerror.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/compiler/aslerror.c')
-rw-r--r--source/compiler/aslerror.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/source/compiler/aslerror.c b/source/compiler/aslerror.c
index 74c220d1214f..a8187fd2ae55 100644
--- a/source/compiler/aslerror.c
+++ b/source/compiler/aslerror.c
@@ -294,7 +294,7 @@ AePrintException (
else
{
RActual = fread (&SourceByte, 1, 1, SourceFile);
- if (!RActual)
+ if (RActual != 1)
{
fprintf (OutputFile,
"[*** iASL: Read error on source code temp file %s ***]",
@@ -304,8 +304,20 @@ 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);
+ if (RActual != 1)
+ {
+ fprintf (OutputFile,
+ "[*** iASL: Read error on source code temp file %s ***]",
+ Gbl_Files[ASL_FILE_SOURCE_OUTPUT].Filename);
+ return;
+ }
Total++;
}