From 33c99ff24b9c8712be96e96d4d82f34f72070bd1 Mon Sep 17 00:00:00 2001 From: Robert Moore Date: Thu, 25 Oct 2012 08:50:57 -0700 Subject: iASL: Add check for return value from fwrite(). Ensure that the fwrite did not fail. --- source/compiler/aslerror.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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++; } -- cgit v1.2.1