fix in flushbuf: make sure it does not return EOF when it actually succeeds
This commit is contained in:
		
							parent
							
								
									73b54a2326
								
							
						
					
					
						commit
						6ec3dd7ebd
					
				
					 1 changed files with 2 additions and 2 deletions
				
			
		|  | @ -80,7 +80,7 @@ __flushbuf(int c, FILE * stream) | ||||||
| 			stream->_flags |= _IOERR; | 			stream->_flags |= _IOERR; | ||||||
| 			return EOF; | 			return EOF; | ||||||
| 		} | 		} | ||||||
| 		return c; | 		return (unsigned char) c; | ||||||
| 	} else if (io_testflag(stream, _IOLBF)) { | 	} else if (io_testflag(stream, _IOLBF)) { | ||||||
| 		*stream->_ptr++ = c; | 		*stream->_ptr++ = c; | ||||||
| 		/* stream->_count has been updated in putc macro. */ | 		/* stream->_count has been updated in putc macro. */ | ||||||
|  | @ -123,5 +123,5 @@ __flushbuf(int c, FILE * stream) | ||||||
| 		} | 		} | ||||||
| 		*(stream->_buf) = c; | 		*(stream->_buf) = c; | ||||||
| 	} | 	} | ||||||
| 	return c; | 	return (unsigned char) c; | ||||||
| } | } | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue