From: Tony Cook Date: Thu, 22 Sep 2011 12:35:07 +0000 (+1000) Subject: actually store the character in the i_io_putc() macro X-Git-Tag: v_iobuf~17 X-Git-Url: http://git.imager.perl.org/imager.git/commitdiff_plain/7cfdd0cfde8b63760fb1817812ca53cbbb479b5b actually store the character in the i_io_putc() macro --- diff --git a/iolayert.h b/iolayert.h index 8256b2b7..fa177e53 100644 --- a/iolayert.h +++ b/iolayert.h @@ -92,9 +92,9 @@ struct i_io_glue_t { *((ig)->read_ptr) : \ i_io_peekc_imp(ig)) #define i_io_putc(ig, c) \ - ((ig)->write_ptr < (ig)->write_end ? \ - *(ig)->write_ptr++ : \ - i_io_putc_imp(ig, c)) + ((ig)->write_ptr < (ig)->write_end && !(ig)->error ? \ + *(ig)->write_ptr++ = (c) : \ + i_io_putc_imp(ig, (c))) #define i_io_eof(ig) \ ((ig)->read_ptr == (ig)->read_end && (ig)->buf_eof) #define i_io_error(ig) \