--------------------- PatchSet 6463 Date: 2005/03/03 03:20:01 Author: hno Branch: lfs-2_5 Tag: (none) Log: Don't over-use the off_t type when int is sufficient Members: lib/rfc1035.c:1.7.6.6.6.1->1.7.6.6.6.2 Index: squid/lib/rfc1035.c =================================================================== RCS file: /cvsroot/squid-sf//squid/lib/rfc1035.c,v retrieving revision 1.7.6.6.6.1 retrieving revision 1.7.6.6.6.2 diff -u -r1.7.6.6.6.1 -r1.7.6.6.6.2 --- squid/lib/rfc1035.c 3 Mar 2005 03:17:35 -0000 1.7.6.6.6.1 +++ squid/lib/rfc1035.c 3 Mar 2005 03:20:01 -0000 1.7.6.6.6.2 @@ -1,6 +1,6 @@ /* - * $Id: rfc1035.c,v 1.7.6.6.6.1 2005/03/03 03:17:35 hno Exp $ + * $Id: rfc1035.c,v 1.7.6.6.6.2 2005/03/03 03:20:01 hno Exp $ * * Low level DNS protocol routines * AUTHOR: Duane Wessels @@ -113,10 +113,10 @@ * Packs a rfc1035_header structure into a buffer. * Returns number of octets packed (should always be 12) */ -static off_t +static int rfc1035HeaderPack(char *buf, size_t sz, rfc1035_header * hdr) { - off_t off = 0; + int off = 0; unsigned short s; unsigned short t; assert(sz >= 12); @@ -158,10 +158,10 @@ * bytes to follow. Labels must be smaller than 64 octets. * Returns number of octets packed. */ -static off_t +static int rfc1035LabelPack(char *buf, size_t sz, const char *label) { - off_t off = 0; + int off = 0; size_t len = label ? strlen(label) : 0; if (label) assert(!strchr(label, '.')); @@ -183,10 +183,10 @@ * Note message compression is not supported here. * Returns number of octets packed. */ -static off_t +static int rfc1035NamePack(char *buf, size_t sz, const char *name) { - off_t off = 0; + int off = 0; char *copy = strdup(name); char *t; /* @@ -206,14 +206,14 @@ * Packs a QUESTION section of a message. * Returns number of octets packed. */ -static off_t +static int rfc1035QuestionPack(char *buf, size_t sz, const char *name, unsigned short type, unsigned short class) { - off_t off = 0; + int off = 0; unsigned short s; off += rfc1035NamePack(buf + off, sz - off, name); s = htons(type); @@ -238,7 +238,7 @@ * Returns 0 (success) or 1 (error) */ static int -rfc1035HeaderUnpack(const char *buf, size_t sz, off_t * off, rfc1035_header * h) +rfc1035HeaderUnpack(const char *buf, size_t sz, int * off, rfc1035_header * h) { unsigned short s; unsigned short t;