Trivial changes: whitespace and modes.

Remote whitespace at the ends of lines.
Remove blank lines from the ends of files.
Change modes on source files so that they
are not executable.

Signed-off-by: Dan Cross <cross@gajendra.net>
This commit is contained in:
Dan Cross 2020-01-10 14:44:21 +00:00
parent 77a0a5b519
commit fa325e9b42
1021 changed files with 5688 additions and 6193 deletions

View file

@ -34,7 +34,7 @@ csipinfo(char *netroot, char *attr, char *val, char **list, int n)
break;
p = seprint(p, e, " %s", *list++);
}
if(write(fd, line, strlen(line)) < 0){
close(fd);
return 0;

View file

@ -119,11 +119,11 @@ doquery(int fd, char *dn, char *type)
snprint(buf, sizeof(buf), "!%s %s", dn, type);
if(write(fd, buf, strlen(buf)) < 0)
return nil;
seek(fd, 0, 0);
first = last = nil;
for(;;){
n = read(fd, buf, sizeof(buf)-2);
if(n <= 0)

View file

@ -60,7 +60,7 @@ _ndbparsetuple(char *cp, Ndbtuple **tp)
}
/*
* parse all tuples in a line. we assume that the
* parse all tuples in a line. we assume that the
* line ends in a '\n'.
*
* the tuples are linked as a list using ->entry and

View file

@ -9,7 +9,7 @@ struct Ndbcache
char *attr;
char *val;
Ndbs s;
Ndbtuple *t;
Ndbtuple *t;
};
enum

View file

@ -61,5 +61,5 @@ ndbnew(char *attr, char *val)
t->val = t->valbuf;
if(val != nil)
ndbsetval(t, val, strlen(val));
return t;
return t;
}

View file

@ -198,7 +198,7 @@ ndbsnext(Ndbs *s, char *attr, char *val)
ndbfree(t);
} else if(s->type == Cptr){
if(Bseek(&db->b, s->ptr, 0) < 0)
break;
break;
s->ptr = s->ptr1;
s->type = Cptr1;
t = ndbparse(db);
@ -218,7 +218,7 @@ ndbsnext(Ndbs *s, char *attr, char *val)
s->type = Cptr;
} else { /* end of hash chain */
if(Bseek(&db->b, s->ptr, 0) < 0)
break;
break;
s->ptr = NDBNAP;
t = ndbparse(db);
if(t == 0)

View file

@ -77,7 +77,7 @@ doopen(char *file, char *rel)
* Unrooted paths are taken relative to db we opened.
*/
if(file[0]!='/' && rel && (p=strrchr(rel, '/'))!=nil)
snprint(db->file, sizeof(db->file), "%.*s/%s",
snprint(db->file, sizeof(db->file), "%.*s/%s",
utfnlen(rel, p-rel), rel, file);
else
strncpy(db->file, file, sizeof(db->file)-1);

View file

@ -27,7 +27,7 @@ ndbreorder(Ndbtuple *t, Ndbtuple *x)
for(nt = t; nt->entry != last->line; nt = nt->entry)
;
nt->entry = nil;
/* switch */
for(nt = last; nt->entry != nil; nt = nt->entry)
;

View file

@ -20,11 +20,11 @@ Ndbtuple*
dnsquery(char *net, char *val, char *type)
{
static int init;
char rip[128];
char rip[128];
Ndbtuple *t;
USED(net);
if(!init){
init = 1;
fmtinstall('I', eipfmt);
@ -32,17 +32,17 @@ dnsquery(char *net, char *val, char *type)
/* give up early on stupid questions - vwhois */
if(strcmp(val, "::") == 0 || strcmp(val, "0.0.0.0") == 0)
return nil;
/* zero out the error string */
werrstr("");
/* if this is a reverse lookup, first look up the domain name */
if(strcmp(type, "ptr") == 0){
mkptrname(val, rip, sizeof rip);
t = doquery(rip, "ptr");
}else
t = doquery(val, type);
return t;
}
@ -123,7 +123,7 @@ enum
/* query types (all RR types are also queries) */
Tixfr= 251, /* incremental zone transfer */
Taxfr= 252, /* zone transfer */
Tmailb= 253, /* { Tmb, Tmg, Tmr } */
Tmailb= 253, /* { Tmb, Tmg, Tmr } */
Tall= 255, /* all records */
/* classes */
@ -173,7 +173,7 @@ doquery(char *name, char *type)
qdcount = (buf[4]<<8)|buf[5];
ancount = (buf[6]<<8)|buf[7];
p = buf+12;
p = skipquestion(buf, buf+n, p, qdcount);
p = unpack(buf, buf+n, p, &t, ancount);
@ -215,7 +215,7 @@ static char*
type2name(int t)
{
int i;
for(i=0; i<nelem(dnsnames); i++)
if(dnsnames[i].t == t)
return dnsnames[i].s;
@ -226,7 +226,7 @@ static int
name2type(char *name)
{
int i;
for(i=0; i<nelem(dnsnames); i++)
if(strcmp(name, dnsnames[i].s) == 0)
return dnsnames[i].t;
@ -238,7 +238,7 @@ skipquestion(uchar *buf, uchar *ebuf, uchar *p, int n)
{
int i, len;
char tmp[100];
for(i=0; i<n; i++){
if((len = dn_expand(buf, ebuf, p, tmp, sizeof tmp)) <= 0)
return nil;
@ -304,11 +304,11 @@ rrnext(uchar *buf, uchar *ebuf, uchar *p, Ndbtuple **tt)
return nil;
}
p += len;
rrtype = G2(p);
rrlen = G2(p+8);
p += 10;
if(rrtype == Tptr)
first = ndbnew("ptr", b);
else
@ -363,19 +363,19 @@ rrnext(uchar *buf, uchar *ebuf, uchar *p, Ndbtuple **tt)
break;
case Tsoa:
t = rrunpack(buf, ebuf, &p, "NNLLLLL", "ns", "mbox",
t = rrunpack(buf, ebuf, &p, "NNLLLLL", "ns", "mbox",
"serial", "refresh", "retry", "expire", "ttl");
break;
case Tkey:
t = rrunpack(buf, ebuf, &p, "SCCY", "flags", "proto", "alg", "key");
break;
case Tsig:
t = rrunpack(buf, ebuf, &p, "SCCLLLSNY", "type", "alg", "labels",
"ttl", "exp", "incep", "tag", "signer", "sig");
break;
case Tcert:
t = rrunpack(buf, ebuf, &p, "SSCY", "type", "tag", "alg", "cert");
break;
@ -398,7 +398,7 @@ rrunpack(uchar *buf, uchar *ebuf, uchar **pp, char *fmt, ...)
va_list arg;
Ndbtuple *t, *first, *last;
char tmp[Ndbvlen];
p = *pp;
va_start(arg, fmt);
first = nil;

View file

@ -7,22 +7,22 @@ void
main(int argc, char **argv)
{
Ndbtuple *t, *t0;
ARGBEGIN{
default:
goto usage;
}ARGEND
if(argc != 2){
usage:
fprint(2, "usage: testdns name val\n");
exits("usage");
}
quotefmtinstall();
if((t = dnsquery(nil, argv[0], argv[1])) == nil)
sysfatal("dnsquery: %r");
for(t0=t; t; t=t->entry){
print("%s=%q ", t->attr, t->val);
if(t->line == t0){
@ -32,4 +32,3 @@ main(int argc, char **argv)
}
exits(0);
}