From 4322e7093eccb78d6d67238979369990211f3edb Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Mon, 18 May 2015 21:17:21 +0100 Subject: [PATCH] Fix a compile warning with -DDEBUG. An unguarded write() in the dputs function caused gcc -Werror to fail to compile. I'm confused that this hasn't bitten me before, though - obviously normal builds of PuTTY condition out the faulty code, but _surely_ this can't be the first time I've enabled the developer diagnostics since gcc started complaining about unchecked syscall returns! (cherry picked from commit 35fde00fd1fdc084a78dc3e4c3f94dbf16bbd236) --- unix/uxmisc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unix/uxmisc.c b/unix/uxmisc.c index 473aa94e..e65a3869 100644 --- a/unix/uxmisc.c +++ b/unix/uxmisc.c @@ -103,7 +103,7 @@ void dputs(char *buf) debug_fp = fopen("debug.log", "w"); } - write(1, buf, strlen(buf)); + if (write(1, buf, strlen(buf)) < 0) {} /* 'error check' to placate gcc */ fputs(buf, debug_fp); fflush(debug_fp);