libs/wpp/ppl.l: Check return value of fwrite to prevent gcc warnings. exit(1) if fwrite fails. (bug # 16413)
titon barua
titanix88 at gmail.com
Sun Jan 4 10:25:17 CST 2009
---
libs/wpp/ppl.l | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/libs/wpp/ppl.l b/libs/wpp/ppl.l
index e71bf6e..ab2efe6 100644
--- a/libs/wpp/ppl.l
+++ b/libs/wpp/ppl.l
@@ -1440,8 +1440,12 @@ static void put_buffer(const char *s, int len)
{
if(top_macro())
add_text_to_macro(s, len);
- else
- fwrite(s, 1, len, ppy_out);
+ else if (fwrite(s, 1, len, ppy_out) != len)
+ {
+ /* exit if fwrite fails */
+ perror ("fwrite failed");
+ exit (1);
+ }
}
--
1.5.6.3
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.winehq.org/pipermail/wine-patches/attachments/20090104/9f36465c/attachment.htm
More information about the wine-patches
mailing list