diff options
author | Daniel Stenberg <daniel@haxx.se> | 2004-10-06 07:50:18 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2004-10-06 07:50:18 +0000 |
commit | 3e748f4b50224e43b916dda5de438c785bdcd49d (patch) | |
tree | 53bbfe3dae88be1fd482d3fc392cd1465214f4f3 /ares_mkquery.c | |
parent | 47bd7d7548103c44b466fceb1dbda425ce8774bc (diff) | |
download | c-ares-3e748f4b50224e43b916dda5de438c785bdcd49d.tar.gz c-ares-3e748f4b50224e43b916dda5de438c785bdcd49d.tar.bz2 c-ares-3e748f4b50224e43b916dda5de438c785bdcd49d.zip |
removed tabs and trailing whitespace from source
Diffstat (limited to 'ares_mkquery.c')
-rw-r--r-- | ares_mkquery.c | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/ares_mkquery.c b/ares_mkquery.c index d2ae66b..fd9c369 100644 --- a/ares_mkquery.c +++ b/ares_mkquery.c @@ -47,15 +47,15 @@ * * AA, TC, RA, and RCODE are only set in responses. Brief description * of the remaining fields: - * ID Identifier to match responses with queries - * QR Query (0) or response (1) - * Opcode For our purposes, always QUERY - * RD Recursion desired - * Z Reserved (zero) - * QDCOUNT Number of queries - * ANCOUNT Number of answers - * NSCOUNT Number of name server records - * ARCOUNT Number of additional records + * ID Identifier to match responses with queries + * QR Query (0) or response (1) + * Opcode For our purposes, always QUERY + * RD Recursion desired + * Z Reserved (zero) + * QDCOUNT Number of queries + * ANCOUNT Number of answers + * NSCOUNT Number of name server records + * ARCOUNT Number of additional records * * Question format, from RFC 1035: * 1 1 1 1 1 1 @@ -77,7 +77,7 @@ */ int ares_mkquery(const char *name, int dnsclass, int type, unsigned short id, - int rd, unsigned char **buf, int *buflen) + int rd, unsigned char **buf, int *buflen) { int len; unsigned char *q; @@ -89,7 +89,7 @@ int ares_mkquery(const char *name, int dnsclass, int type, unsigned short id, for (p = name; *p; p++) { if (*p == '\\' && *(p + 1) != 0) - p++; + p++; len++; } /* If there are n periods in the name, there are n + 1 labels, and @@ -121,31 +121,31 @@ int ares_mkquery(const char *name, int dnsclass, int type, unsigned short id, while (*name) { if (*name == '.') - return ARES_EBADNAME; + return ARES_EBADNAME; /* Count the number of bytes in this label. */ len = 0; for (p = name; *p && *p != '.'; p++) - { - if (*p == '\\' && *(p + 1) != 0) - p++; - len++; - } + { + if (*p == '\\' && *(p + 1) != 0) + p++; + len++; + } if (len > MAXLABEL) - return ARES_EBADNAME; + return ARES_EBADNAME; /* Encode the length and copy the data. */ *q++ = len; for (p = name; *p && *p != '.'; p++) - { - if (*p == '\\' && *(p + 1) != 0) - p++; - *q++ = *p; - } + { + if (*p == '\\' && *(p + 1) != 0) + p++; + *q++ = *p; + } /* Go to the next label and repeat, unless we hit the end. */ if (!*p) - break; + break; name = p + 1; } |