From: Marc G. Fournier Date: Mon, 26 May 1997 00:26:56 +0000 (+0000) Subject: From: David Friend X-Git-Tag: REL9_0_0~28804 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=cf88367751601df5a5bb38f416021bd532cb630c;p=pg-rex%2Fsyncrep.git From: David Friend Subject: [PATCHES] pqcomprim.c patch This is the patch by Robert Bruccoleri to fix the endian problem. (Actually, it's the reverse of his patch. He must have gotten the order wrong.) --- diff --git a/src/backend/libpq/pqcomprim.c b/src/backend/libpq/pqcomprim.c index d10be39d81..00177da441 100644 --- a/src/backend/libpq/pqcomprim.c +++ b/src/backend/libpq/pqcomprim.c @@ -28,7 +28,7 @@ # define ntoh_l(n) (u_long)(((u_char *)&n)[0] << 24 | \ ((u_char *)&n)[1] << 16 | \ ((u_char *)&n)[2] << 8 | ((u_char *)&n)[3]) -# define hton_s(n) (ntoh_s(n)) +# define hton_s(n) (u_short)(((u_char *) &n)[2] << 8 | ((u_char *) &n)[3]) # define hton_l(n) (ntoh_l(n)) # else /* BYTE_ORDER != BIG_ENDIAN */ # if BYTE_ORDER == PDP_ENDIAN