mirror of
				https://github.com/catchorg/Catch2.git
				synced 2025-10-31 12:17:11 +01:00 
			
		
		
		
	hexEscapeChar: restore stream
The ostream passed as reference to `hexEscapeChar` is manipulated and its original state not restored. This fixes it. Seen via coverity in a downstream project.
This commit is contained in:
		 Axel Huebl
					Axel Huebl
				
			
				
					committed by
					
						 Martin Hořeňovský
						Martin Hořeňovský
					
				
			
			
				
	
			
			
			 Martin Hořeňovský
						Martin Hořeňovský
					
				
			
						parent
						
							bbf70ca74b
						
					
				
				
					commit
					188b3e6511
				
			| @@ -44,9 +44,11 @@ namespace { | ||||
|     } | ||||
|  | ||||
|     void hexEscapeChar(std::ostream& os, unsigned char c) { | ||||
|         std::ios_base::fmtflags f(os.flags()); | ||||
|         os << "\\x" | ||||
|             << std::uppercase << std::hex << std::setfill('0') << std::setw(2) | ||||
|             << static_cast<int>(c); | ||||
|         os.flags(f); | ||||
|     } | ||||
|  | ||||
| } // anonymous namespace | ||||
|   | ||||
		Reference in New Issue
	
	Block a user