diff --git a/library/include/stdio.h b/library/include/stdio.h index ebf6e22..6bba79a 100644 --- a/library/include/stdio.h +++ b/library/include/stdio.h @@ -1,5 +1,5 @@ /* - * $Id: stdio.h,v 1.22 2006-03-06 08:43:48 obarthel Exp $ + * $Id: stdio.h,v 1.23 2010-10-19 09:35:16 obarthel Exp $ * * :ts=4 * @@ -287,9 +287,9 @@ extern char *tmpnam(char *buf); (((FILE *)(f))->num_write_bytes < ((FILE *)(f))->size)) ? \ (((FILE *)(f))->buffer[((FILE *)(f))->num_write_bytes++] = (c), \ (((((FILE *)(f))->flags & __FILE_BUFFER_MASK) == _IOLBF && \ - ((FILE *)(f))->buffer[((FILE *)(f))->num_write_bytes-1] == '\n') ? \ + (c) == '\n') ? \ __flush(f) : \ - (((FILE *)(f))->buffer[((FILE *)(f))->num_write_bytes-1]))) : \ + (c))) : \ fputc((c),(f))) /****************************************************************************/ diff --git a/library/stdio_headers.h b/library/stdio_headers.h index df1e7a1..27c1ed0 100644 --- a/library/stdio_headers.h +++ b/library/stdio_headers.h @@ -1,5 +1,5 @@ /* - * $Id: stdio_headers.h,v 1.31 2008-09-04 12:07:58 obarthel Exp $ + * $Id: stdio_headers.h,v 1.32 2010-10-19 09:35:16 obarthel Exp $ * * :ts=4 * @@ -279,10 +279,9 @@ struct iob #define __putc(c,f,m) \ (((((struct iob *)(f))->iob_BufferWriteBytes < ((struct iob *)(f))->iob_BufferSize)) ? \ (((struct iob *)(f))->iob_Buffer[((struct iob *)(f))->iob_BufferWriteBytes++] = (c), \ - (((m) == IOBF_BUFFER_MODE_LINE && \ - ((struct iob *)(f))->iob_Buffer[((struct iob *)(f))->iob_BufferWriteBytes-1] == '\n') ? \ + (((m) == IOBF_BUFFER_MODE_LINE && (c) == '\n') ? \ __flush(f) : \ - (((struct iob *)(f))->iob_Buffer[((struct iob *)(f))->iob_BufferWriteBytes-1]))) : \ + (c))) : \ __fputc((c),(f),(m))) #define __putc_fully_buffered(c,f) \