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)
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);