diff options
author | Mark Eichin <eichin@mit.edu> | 1994-08-14 04:13:06 +0000 |
---|---|---|
committer | Mark Eichin <eichin@mit.edu> | 1994-08-14 04:13:06 +0000 |
commit | b6ad149dfd5355c25ad19b791b7646c67621d3d5 (patch) | |
tree | dc0d536e331017a91c4ce37f6af1a983bacee083 | |
parent | 21f2741953bbb926f400e23b5d2654435f54e39b (diff) | |
download | krb5-b6ad149dfd5355c25ad19b791b7646c67621d3d5.tar.gz krb5-b6ad149dfd5355c25ad19b791b7646c67621d3d5.tar.xz krb5-b6ad149dfd5355c25ad19b791b7646c67621d3d5.zip |
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
-rw-r--r-- | src/appl/mailquery/configure.in | 3 | ||||
-rw-r--r-- | src/appl/mailquery/mailquery.c | 8 | ||||
-rw-r--r-- | 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 dbc21bb394..63ff7f371f 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 6f4d0b2745..9062127cca 100644 --- a/src/appl/mailquery/mailquery.c +++ b/src/appl/mailquery/mailquery.c @@ -27,6 +27,9 @@ #include <fcntl.h> #include <sys/file.h> #include <stdio.h> +#ifdef HAVE_UNISTD_H +#include <unistd.h> +#endif #ifdef HESIOD #include <hesiod.h> #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 3cb856ecdb..5e359d759c 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; |