]> git.imager.perl.org - imager.git/commitdiff
actually store the character in the i_io_putc() macro
authorTony Cook <tony@develop-help.com>
Thu, 22 Sep 2011 12:35:07 +0000 (22:35 +1000)
committerTony Cook <tony@develop-help.com>
Sat, 8 Oct 2011 03:39:46 +0000 (14:39 +1100)
iolayert.h

index 8256b2b719e511e33495c7497183264eae25046d..fa177e53f02f15676632372f340938c2bc7016a3 100644 (file)
@@ -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) \