diff options
Diffstat (limited to 'libexec')
-rw-r--r-- | libexec/spamd/sdl.c | 16 | ||||
-rw-r--r-- | libexec/spamd/spamd.c | 15 |
2 files changed, 17 insertions, 14 deletions
diff --git a/libexec/spamd/sdl.c b/libexec/spamd/sdl.c index 70fb5795920..293a9c76465 100644 --- a/libexec/spamd/sdl.c +++ b/libexec/spamd/sdl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sdl.c,v 1.2 2003/03/02 20:32:05 deraadt Exp $ */ +/* $OpenBSD: sdl.c,v 1.3 2003/03/02 20:40:15 deraadt Exp $ */ /* * Copyright (c) 2003 Bob Beck. All rights reserved. * @@ -50,7 +50,7 @@ struct sdlist *blacklists = NULL; int blc = 0, blu = 0; int -sdl_add (char *sdname, char *sdstring, char ** addrs, int addrc) +sdl_add(char *sdname, char *sdstring, char ** addrs, int addrc) { int i, index = -1; char astring[40]; @@ -76,7 +76,7 @@ sdl_add (char *sdname, char *sdstring, char ** addrs, int addrc) printf("adding list %s\n", sdname); index = blu; } - if (index == blu && blu == blc) { + if (index == blu && blu == blc) { struct sdlist *tmp; tmp = realloc (blacklists, (blc + 128) * sizeof(struct sdlist)); @@ -197,7 +197,7 @@ sdl_lookup(struct sdlist *head, int af, void * src) int i, matches = 0; struct sdlist *sdl; struct sdentry *sda; - struct sdaddr *source = (struct sdaddr *) src ; + struct sdaddr *source = (struct sdaddr *) src; static int sdnewlen = 0; static struct sdlist **sdnew = NULL; @@ -213,10 +213,12 @@ sdl_lookup(struct sdlist *head, int af, void * src) struct sdlist **tmp; tmp = realloc(sdnew, (sdnewlen + 128) * - sizeof(struct sdlist *) ); + sizeof(struct sdlist *)); if (tmp == NULL) - /* XXX out of memory - return - what we have */ + /* + * XXX out of memory - + * return what we have + */ return(sdnew); sdnew = tmp; sdnewlen += 128; diff --git a/libexec/spamd/spamd.c b/libexec/spamd/spamd.c index 5c9581de40a..9d9fe6c1d4a 100644 --- a/libexec/spamd/spamd.c +++ b/libexec/spamd/spamd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: spamd.c,v 1.12 2003/03/02 20:32:05 deraadt Exp $ */ +/* $OpenBSD: spamd.c,v 1.13 2003/03/02 20:40:15 deraadt Exp $ */ /* * Copyright (c) 2002 Theo de Raadt. All rights reserved. @@ -103,7 +103,8 @@ usage(void) char * grow_obuf(struct con *cp, int off) { - char * tmp; + char *tmp; + if (!cp->obufalloc) cp->obuf = NULL; tmp = realloc(cp->obuf, cp->osize + 8192); @@ -190,8 +191,8 @@ parse_configline(char *line) void parse_configs(void) { - int i; char *start, *end; + int i; if (cbu == cbs) { char *tmp; @@ -363,7 +364,7 @@ append_error_string (struct con *cp, size_t off, char *fmt, int af, void *ia) void -build_reply(struct con * cp) +build_reply(struct con *cp) { struct sdlist **matches; int off = 0; @@ -412,7 +413,7 @@ bad: if (cp->obuf == NULL) { /* we're having a really bad day.. */ cp->obufalloc = 0; /* know not to free or mangle */ - cp->obuf="450 Try again\r\n"; + cp->obuf="450 Try again\n"; } else cp->osize = strlen(cp->obuf) + 1; } @@ -473,7 +474,7 @@ initcon(struct con *cp, int fd, struct sockaddr_in *sin) cp->ol = strlen(cp->op); cp->w = t + 1; cp->s = t; - strlcpy(cp->rend, "\n\r", sizeof cp->rend); + strlcpy(cp->rend, "\n", sizeof cp->rend); clients++; } @@ -899,7 +900,7 @@ main(int argc, char *argv[]) err(1, "accept"); } } - if (conffd != -1 && FD_ISSET(conffd, fdsr)) { + if (conffd != -1 && FD_ISSET(conffd, fdsr)) { do_config(); } |