From 122849f247368de15e7db238fae835d31a788ca9 Mon Sep 17 00:00:00 2001 From: Kevin Easton Date: Wed, 8 Feb 2012 12:53:16 +0000 Subject: [PATCH] Replace _getshort() and _getlong() with NS_GET16() and NS_GET32() respectively. Fixes compilation on cygwin (and possibly other targets). git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@148 13b04d17-f746-0410-82c6-800466cd88b0 --- Changelog | 2 +- source/misc.c | 12 ++++-------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/Changelog b/Changelog index bba625e..6de99b0 100644 --- a/Changelog +++ b/Changelog @@ -1,6 +1,6 @@ [Changes 1.2c01] -* Fix /nslookup command. (caf) +* Fix /nslookup command (including fixing compilation on cygwin). (caf) * Improve /detach error handling and remove bogus F_SETOWN use, reported by madsage. (caf) diff --git a/source/misc.c b/source/misc.c index cd25b20..6ff15f1 100644 --- a/source/misc.c +++ b/source/misc.c @@ -2655,14 +2655,10 @@ static int ar_procanswer(struct reslist *rptr, HEADER *hptr, char *buf, char *eo * the pointer to the right spot. Some of thse are actually * useful so its not a good idea to skip past in one big jump. */ - type = (int)_getshort(cp); - cp += sizeof(short); - class = (int)_getshort(cp); - cp += sizeof(short); - ttl = (unsigned int)_getlong(cp); - cp += INT32SZ; - dlen = (int)_getshort(cp); - cp += sizeof(short); + NS_GET16(type, cp); + NS_GET16(class, cp); + NS_GET32(ttl, cp); + NS_GET16(dlen, cp); rptr->re_type = type; switch(type)