Clean up whitespace.
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Copyright (c) 1983, 1990, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
@ -13,7 +13,7 @@
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
@ -29,14 +29,14 @@
|
||||
|
||||
/*
|
||||
* Portions Copyright (c) 1993 by Digital Equipment Corporation.
|
||||
*
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies, and that
|
||||
* the name of Digital Equipment Corporation not be used in advertising or
|
||||
* publicity pertaining to distribution of the document or software without
|
||||
* specific, written prior permission.
|
||||
*
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
|
||||
* WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
|
||||
@ -92,7 +92,7 @@ __FBSDID("$FreeBSD$");
|
||||
#include "port_after.h"
|
||||
#endif
|
||||
|
||||
/*
|
||||
/*
|
||||
* Check whether "cp" is a valid ascii representation
|
||||
* of an Internet address and convert to a binary address.
|
||||
* Returns 1 if the address is valid, 0 if not.
|
||||
@ -134,7 +134,7 @@ cygwin_inet_aton(const char *cp, struct in_addr *addr) {
|
||||
val = (val * base) + (c - '0');
|
||||
c = *++cp;
|
||||
digit = 1;
|
||||
} else if (base == 16 && isascii(c) &&
|
||||
} else if (base == 16 && isascii(c) &&
|
||||
isxdigit((unsigned char)c)) {
|
||||
val = (val << 4) |
|
||||
(c + 10 - (islower((unsigned char)c) ? 'a' : 'A'));
|
||||
|
@ -451,11 +451,11 @@ int res_nsend( res_state statp, const unsigned char * MsgPtr,
|
||||
return ((os_query_t *) statp->os_query)(statp, DomName, Class, Type, AnsPtr, AnsLength);
|
||||
}
|
||||
else {
|
||||
/* dn_expand sets errno */
|
||||
/* dn_expand sets errno */
|
||||
statp->res_h_errno = NETDB_INTERNAL;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Close the socket if it had been opened before a fork.
|
||||
Reuse of pid's cannot hurt */
|
||||
@ -488,7 +488,7 @@ int res_nsend( res_state statp, const unsigned char * MsgPtr,
|
||||
This routine runs through the retry loop for each incorrect answer.
|
||||
It is thus extremely likely that such attacks will cause a TRY_AGAIN return,
|
||||
probably causing the calling program to retry after a delay.
|
||||
|
||||
|
||||
Note that valid late or duplicate answers to a previous questions also cause
|
||||
a retry, although this is minimized by flushing the socket before sending the
|
||||
new question.
|
||||
@ -498,8 +498,8 @@ int res_nsend( res_state statp, const unsigned char * MsgPtr,
|
||||
while ((rslt = cygwin_recvfrom( statp->sockfd, AnsPtr, AnsLength, 0, NULL, NULL)) >= 0) {
|
||||
DPRINTF(debug, "Flushed %d bytes\n", rslt);
|
||||
}
|
||||
DPRINTF(debug && (errno != EWOULDBLOCK),
|
||||
"Unexpected errno for flushing recvfrom: %s", strerror(errno));
|
||||
DPRINTF(debug && (errno != EWOULDBLOCK),
|
||||
"Unexpected errno for flushing recvfrom: %s", strerror(errno));
|
||||
|
||||
/* Send the message */
|
||||
rslt = cygwin_sendto(statp->sockfd, MsgPtr, MsgLength, 0,
|
||||
@ -540,8 +540,8 @@ int res_nsend( res_state statp, const unsigned char * MsgPtr,
|
||||
return -1;
|
||||
}
|
||||
DPRINTF(debug, "recvfrom: %d bytes from %08x\n", rslt, dnsSockAddr.sin_addr.s_addr);
|
||||
/*
|
||||
Prepare to retry with tcp
|
||||
/*
|
||||
Prepare to retry with tcp
|
||||
*/
|
||||
for (tcp = 0; tcp < 2; tcp++) {
|
||||
/* Check if this is the expected message from the expected server */
|
||||
@ -561,11 +561,11 @@ int res_nsend( res_state statp, const unsigned char * MsgPtr,
|
||||
&& (rslt >= MsgLength)
|
||||
&& (memcmp(MsgPtr + HFIXEDSZ, AnsPtr + HFIXEDSZ, MsgLength - HFIXEDSZ) == 0)))) {
|
||||
if ((AnsPtr[3] & ERR_MASK) == NOERROR) {
|
||||
if ((AnsPtr[2] & TC) && (tcp == 0) && !(statp->options & RES_IGNTC)) {
|
||||
if ((AnsPtr[2] & TC) && (tcp == 0) && !(statp->options & RES_IGNTC)) {
|
||||
/* Truncated. Try TCP */
|
||||
rslt = get_tcp(&statp->nsaddr_list[wServ], MsgPtr, MsgLength,
|
||||
AnsPtr, AnsLength, statp->options & RES_DEBUG);
|
||||
continue /* Tcp loop */;
|
||||
continue /* Tcp loop */;
|
||||
}
|
||||
else if ((AnsPtr[6] | AnsPtr[7])!= 0)
|
||||
return rslt;
|
||||
@ -588,7 +588,7 @@ int res_nsend( res_state statp, const unsigned char * MsgPtr,
|
||||
case FORMERR:
|
||||
statp->res_h_errno = HOST_NOT_FOUND;
|
||||
break;
|
||||
case SERVFAIL:
|
||||
case SERVFAIL:
|
||||
statp->res_h_errno = TRY_AGAIN;
|
||||
break;
|
||||
default:
|
||||
@ -644,7 +644,7 @@ int res_nmkquery (res_state statp,
|
||||
|
||||
/* Fill the header */
|
||||
PUTSHORT(statp->id, buf);
|
||||
PUTSHORT(RD, buf);
|
||||
PUTSHORT(RD, buf);
|
||||
PUTSHORT(1, buf); /* Number of questions */
|
||||
for (i = 0; i < 3; i++)
|
||||
PUTSHORT(0, buf); /* Number of answers */
|
||||
@ -655,14 +655,14 @@ int res_nmkquery (res_state statp,
|
||||
PUTSHORT(qclass, buf);
|
||||
|
||||
/* Update id. The current query adds entropy to the next query id */
|
||||
for (id4 = qtype, i = 0, ptr = dnameptr; *ptr; ptr++, i += 3)
|
||||
for (id4 = qtype, i = 0, ptr = dnameptr; *ptr; ptr++, i += 3)
|
||||
id4 ^= *ptr << (i & 0xF);
|
||||
i = 1 + statp->id % 15; /* Between 1 and 16 */
|
||||
/* id dependent rotation, also brings MSW to LSW */
|
||||
id4 = (id4 << i) ^ (id4 >> (16 - i)) ^ (id4 >> (32 - i));
|
||||
if ((short) id4)
|
||||
statp->id ^= (short) id4;
|
||||
else
|
||||
else
|
||||
statp->id++; /* Force change */
|
||||
|
||||
return len + (HFIXEDSZ + QFIXEDSZ); /* packet size */
|
||||
|
@ -430,7 +430,7 @@ iruserok_sa(const void *ra, int rlen, int superuser, const char *ruser,
|
||||
struct sockaddr_storage ss;
|
||||
|
||||
/* avoid alignment issue */
|
||||
if (rlen > (int) sizeof(ss))
|
||||
if (rlen > (int) sizeof(ss))
|
||||
return(-1);
|
||||
memcpy(&ss, ra, rlen);
|
||||
raddr = (struct sockaddr *)&ss;
|
||||
|
@ -296,9 +296,9 @@ strfmon(char * __restrict s, size_t maxsize, const char * __restrict format,
|
||||
*
|
||||
* = 0 - parentheses enclose the quantity and the
|
||||
* $currency_symbol
|
||||
* = 1 - the sign string precedes the quantity and the
|
||||
* = 1 - the sign string precedes the quantity and the
|
||||
* $currency_symbol
|
||||
* = 2 - the sign string succeeds the quantity and the
|
||||
* = 2 - the sign string succeeds the quantity and the
|
||||
* $currency_symbol
|
||||
* = 3 - the sign string precedes the $currency_symbol
|
||||
* = 4 - the sign string succeeds the $currency_symbol
|
||||
|
@ -275,21 +275,21 @@ find_alt_digits (const unsigned char *bp, alt_digits_t *adi, uint *pval)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static int
|
||||
static int
|
||||
is_leap_year (int year)
|
||||
{
|
||||
{
|
||||
return (year % 4) == 0 && ((year % 100) != 0 || (year % 400) == 0);
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
static int
|
||||
first_day (int year)
|
||||
{
|
||||
{
|
||||
int ret = 4;
|
||||
|
||||
|
||||
while (--year >= 1970)
|
||||
ret = (ret + 365 + is_leap_year (year)) % 7;
|
||||
return ret;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* This simplifies the calls to conv_num enormously. */
|
||||
#define ALT_DIGITS ((alt_format & ALT_O) ? *alt_digits : NULL)
|
||||
|
Reference in New Issue
Block a user