mirror of
				https://github.com/pocoproject/poco.git
				synced 2025-10-30 13:47:10 +01:00 
			
		
		
		
	fixed GH #1570: IPv6AddressImpl::toString() returns wrong output for IPv6 address "::"
This commit is contained in:
		| @@ -432,13 +432,16 @@ std::string IPv6AddressImpl::toString() const | ||||
| 		else | ||||
| 			result.append("::ffff:"); | ||||
| 		const UInt8* bytes = reinterpret_cast<const UInt8*>(&_addr); | ||||
| 		NumberFormatter::append(result, bytes[12]); | ||||
| 		result.append("."); | ||||
| 		NumberFormatter::append(result, bytes[13]); | ||||
| 		result.append("."); | ||||
| 		NumberFormatter::append(result, bytes[14]); | ||||
| 		result.append("."); | ||||
| 		NumberFormatter::append(result, bytes[15]); | ||||
| 		if (bytes[12] != 0) // only 0.0.0.0 can start with zero | ||||
| 		{ | ||||
| 			NumberFormatter::append(result, bytes[12]); | ||||
| 			result.append("."); | ||||
| 			NumberFormatter::append(result, bytes[13]); | ||||
| 			result.append("."); | ||||
| 			NumberFormatter::append(result, bytes[14]); | ||||
| 			result.append("."); | ||||
| 			NumberFormatter::append(result, bytes[15]); | ||||
| 		} | ||||
| 		return result; | ||||
| 	} | ||||
| 	else | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Guenter Obiltschnig
					Guenter Obiltschnig