X-Git-Url: https://git.distorted.org.uk/~mdw/udpkey/blobdiff_plain/46716e8f42305a5b622274ebe53bad13d3f54bab..c33ded254b17ed0b7871ec8ef08ddf447df08952:/udpkey.c diff --git a/udpkey.c b/udpkey.c index d8845e1..aede953 100644 --- a/udpkey.c +++ b/udpkey.c @@ -59,6 +59,7 @@ #include #include +#include #include #include #include @@ -149,7 +150,7 @@ static int snarf(const char *name, void **p, size_t *sz) * otherwise write to stderr. Don't use `%m' because that won't work when * writing to stderr. */ -static void complain(int sev, const char *msg, ...) +static void PRINTF_LIKE(2, 3) complain(int sev, const char *msg, ...) { va_list ap; @@ -473,7 +474,7 @@ static void debug_ge(const char *what, group *g, ge *X) /* Rate limiting parameters. * * There's a probabilistic rate-limiting mechanism. A counter starts at 0. - * Every time we oricess a request, we increment the counter. The counter + * Every time we process a request, we increment the counter. The counter * drops by RATE_REFILL every second. If the counter is below RATE_CREDIT * then the request is processed; otherwise it is processed with probability * 1/(counter - RATE_CREDIT). @@ -879,7 +880,7 @@ static struct query *qinit_file(const char *tag, const char *file) return (q); } -/* Reransmission and timeout parameters. */ +/* Retransmission and timeout parameters. */ #define TO_NEXT(t) (((t) + 2)*4/3) /* Timeout growth function */ #define TO_MAX 30 /* When to give up */ @@ -980,7 +981,7 @@ static int doquery(int argc, char *argv[]) } /* Wee whether this corresponds to any of our servers. Don't just - * check the active servers, since this may be late replies caused by + * check the active servers, since this may be late a reply caused by * retransmissions or similar. */ for (q = qq; q; q = q->next) { @@ -1044,7 +1045,7 @@ static int doquery(int argc, char *argv[]) h = GM_INIT(m); GH_HASH(h, p, n); tt = GH_DONE(h, 0); - if (memcmp(t, tt, s->k.tagsz) != 0) { + if (!ct_memeq(t, tt, s->k.tagsz)) { moan("incorrect tag from %s:%d", inet_ntoa(sin.sin_addr), ntohs(sin.sin_port)); goto again; @@ -1110,7 +1111,7 @@ static void usage(FILE *fp) } static void version(FILE *fp) - { pquis(fp, "$, version " VERSION); } + { pquis(fp, "$, version " VERSION "\n"); } static void help(FILE *fp) {