@@ -1,7 +1,7 @@ /* - * Copyright (c) 2008-2023 Jonathan Schleifer + * Copyright (c) 2008-2024 Jonathan Schleifer * * All rights reserved. * * This file is part of ObjFW. It may be distributed under the terms of the * Q Public License 1.0, which can be found in the file LICENSE.QPL included in @@ -431,15 +431,15 @@ OFDNSResourceRecord *record; if (*i + 10 > length) @throw [OFTruncatedDataException exception]; - recordType = (buffer[*i] << 16) | buffer[*i + 1]; - DNSClass = (buffer[*i + 2] << 16) | buffer[*i + 3]; + recordType = (buffer[*i] << 8) | buffer[*i + 1]; + DNSClass = (buffer[*i + 2] << 8) | buffer[*i + 3]; TTL = (buffer[*i + 4] << 24) | (buffer[*i + 5] << 16) | (buffer[*i + 6] << 8) | buffer[*i + 7]; - dataLength = (buffer[*i + 8] << 16) | buffer[*i + 9]; + dataLength = (buffer[*i + 8] << 8) | buffer[*i + 9]; *i += 10; if (*i + dataLength > length) @throw [OFTruncatedDataException exception];