From a1645303f75579b3ee819819095428126cfb2a26 Mon Sep 17 00:00:00 2001 From: Florian Zeitz Date: Thu, 3 Jan 2013 22:27:26 +0100 Subject: [PATCH] Adjust to recent ObjFW changes. --- src/XMPPSRVLookup.m | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/XMPPSRVLookup.m b/src/XMPPSRVLookup.m index fda3e63..6c9828c 100644 --- a/src/XMPPSRVLookup.m +++ b/src/XMPPSRVLookup.m @@ -196,6 +196,7 @@ { OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; unsigned char *answer = NULL; + size_t pageSize = [OFSystemInfo pageSize]; OFString *request; request = [OFString stringWithFormat: @"_xmpp-client._tcp.%@", domain]; @@ -211,16 +212,16 @@ socket: nil host: domain]; - answer = [self allocMemoryWithSize: of_pagesize]; + answer = [self allocMemoryWithSize: pageSize]; answerLen = res_nsearch(&resState, [request cStringUsingEncoding: OF_STRING_ENCODING_NATIVE], - ns_c_in, ns_t_srv, answer, (int)of_pagesize); + ns_c_in, ns_t_srv, answer, (int)pageSize); if ((answerLen == -1) && ((h_errno == HOST_NOT_FOUND) || (h_errno == NO_DATA))) return; - if (answerLen < 1 || answerLen > of_pagesize) { + if (answerLen < 1 || answerLen > pageSize) { @throw [OFAddressTranslationFailedException exceptionWithClass: [self class] socket: nil