mirror of https://github.com/ARMmbed/mbed-os.git
				
				
				
			Fix: Stream: Replace fflush() with fseek()
This is a follow-up to PR #8331; fixing the Stream methods not covered there.pull/9033/head
							parent
							
								
									5c9cc5b8f1
								
							
						
					
					
						commit
						89a475bc4e
					
				| 
						 | 
				
			
			@ -147,7 +147,7 @@ int Stream::printf(const char *format, ...)
 | 
			
		|||
    lock();
 | 
			
		||||
    std::va_list arg;
 | 
			
		||||
    va_start(arg, format);
 | 
			
		||||
    fflush(_file);
 | 
			
		||||
    std::fseek(_file, 0, SEEK_CUR);
 | 
			
		||||
    int r = vfprintf(_file, format, arg);
 | 
			
		||||
    va_end(arg);
 | 
			
		||||
    unlock();
 | 
			
		||||
| 
						 | 
				
			
			@ -169,7 +169,7 @@ int Stream::scanf(const char *format, ...)
 | 
			
		|||
int Stream::vprintf(const char *format, std::va_list args)
 | 
			
		||||
{
 | 
			
		||||
    lock();
 | 
			
		||||
    fflush(_file);
 | 
			
		||||
    std::fseek(_file, 0, SEEK_CUR);
 | 
			
		||||
    int r = vfprintf(_file, format, args);
 | 
			
		||||
    unlock();
 | 
			
		||||
    return r;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue