From b6ad149dfd5355c25ad19b791b7646c67621d3d5 Mon Sep 17 00:00:00 2001 From: Mark Eichin Date: Sun, 14 Aug 1994 04:13:06 +0000 Subject: [PATCH] test for -lsocket -lnsl and unistd.h strchr not index no bogus decls attempt to fix return values explicitly declare arguments git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@4129 dc483132-0cff-0310-8789-dd5450dbe970 --- src/appl/mailquery/configure.in | 3 +++ src/appl/mailquery/mailquery.c | 8 +++++--- src/appl/mailquery/poplib.c | 8 +++++--- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/appl/mailquery/configure.in b/src/appl/mailquery/configure.in index dbc21bb39..63ff7f371 100644 --- a/src/appl/mailquery/configure.in +++ b/src/appl/mailquery/configure.in @@ -2,6 +2,9 @@ AC_INIT(mailquery.c) WITH_CCOPTS AC_SET_BUILDTOP AC_PROG_INSTALL +AC_HAVE_LIBRARY(socket) +AC_HAVE_LIBRARY(nsl) +AC_HAVE_HEADERS(unistd.h) WITH_KRB5ROOT CONFIG_RULES AC_FUNC_CHECK(strerror,AC_DEFINE(HAS_STRERROR)) diff --git a/src/appl/mailquery/mailquery.c b/src/appl/mailquery/mailquery.c index 6f4d0b274..9062127cc 100644 --- a/src/appl/mailquery/mailquery.c +++ b/src/appl/mailquery/mailquery.c @@ -27,6 +27,9 @@ #include #include #include +#ifdef HAVE_UNISTD_H +#include +#endif #ifdef HESIOD #include #endif @@ -53,7 +56,6 @@ main(argc, argv) #ifdef HESIOD struct hes_postoffice *p; #endif /* HESIOD */ - char *index(); while ((c = getopt(argc, argv, "dve:")) != EOF) { switch (c) { @@ -80,7 +82,7 @@ main(argc, argv) if (argc > 0) { user = argv[0]; - if ((mhost = index(argv[0], '@')) != NULL) { + if ((mhost = strchr(argv[0], '@')) != NULL) { *mhost = '\0'; mhost++; } @@ -166,7 +168,7 @@ mailquery(mhost, user) return nbytes; } -usage() +void usage() { fprintf(stderr, "usage: mailquery [-d] [-v] [-e cmd] [user[@host]]\n"); } diff --git a/src/appl/mailquery/poplib.c b/src/appl/mailquery/poplib.c index 3cb856ecd..5e359d759 100644 --- a/src/appl/mailquery/poplib.c +++ b/src/appl/mailquery/poplib.c @@ -85,7 +85,7 @@ int reserved; #endif if (sfi && sfo) { - return; + return OK; /* guessing at this -- eichin -- XXX */ } hp = gethostbyname(host); @@ -113,7 +113,7 @@ int reserved; } sin.sin_family = hp->h_addrtype; - bcopy(hp->h_addr, (char *)&sin.sin_addr, hp->h_length); + memcpy((char *)&sin.sin_addr, hp->h_addr, hp->h_length); sin.sin_port = sp->s_port; #ifdef KPOP s = socket(AF_INET, SOCK_STREAM, 0); @@ -232,9 +232,9 @@ int reserved; pop_command(fmt, a, b, c, d) char *fmt; +char *a, *b, *c, *d; { char buf[1024]; - char errmsg[64]; sprintf(buf, fmt, a, b, c, d); @@ -309,7 +309,9 @@ int *nmsgs, *nbytes; } pop_retr(msgno, action, arg) +int msgno; int (*action)(); +char *arg; /* is this always FILE*??? -- XXX */ { char buf[1024]; int nbytes = 0; -- 2.26.2