diff options
author | jmallett <jmallett@FreeBSD.org> | 2003-04-03 05:13:27 +0000 |
---|---|---|
committer | jmallett <jmallett@FreeBSD.org> | 2003-04-03 05:13:27 +0000 |
commit | eba71bcf69b1a44d8ff32c0aa0c0400d682b5dec (patch) | |
tree | ea700d011536a0f7f4ef18463e1769cfb052ce7e /libexec/talkd/print.c | |
parent | 5b2b2811a19544037b626ef44e598691b3b2f525 (diff) | |
download | FreeBSD-src-eba71bcf69b1a44d8ff32c0aa0c0400d682b5dec.zip FreeBSD-src-eba71bcf69b1a44d8ff32c0aa0c0400d682b5dec.tar.gz |
MFp4 @27667: WARNS=5 cleanup on i386.
Remove the unused FILE\ *tf from print_mesg args, and the
bogus passing in of an uninitialised FILE* for it.
Call a timeval 'now' instead of 'clock' due to shadowing.
Remove a nested localtime declaration.
Make the delete invite argument match the ID type, u_int32_t.
Use const for pointers to const items.
Cast to long where printing as such.
Include netinet/in.h for htonl/htons.
Reviewed by: imp
Diffstat (limited to 'libexec/talkd/print.c')
-rw-r--r-- | libexec/talkd/print.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/libexec/talkd/print.c b/libexec/talkd/print.c index 355910c..6c39d8d 100644 --- a/libexec/talkd/print.c +++ b/libexec/talkd/print.c @@ -50,10 +50,10 @@ static const char rcsid[] = #include "extern.h" -static char *types[] = +static const char *types[] = { "leave_invite", "look_up", "delete", "announce" }; #define NTYPES (sizeof (types) / sizeof (types[0])) -static char *answers[] = +static const char *answers[] = { "success", "not_here", "failed", "machine_unknown", "permission_denied", "unknown_request", "badversion", "badaddr", "badctladdr" }; #define NANSWERS (sizeof (answers) / sizeof (answers[0])) @@ -61,7 +61,8 @@ static char *answers[] = void print_request(const char *cp, CTL_MSG *mp) { - char tbuf[80], *tp; + const char *tp; + char tbuf[80]; if (mp->type > NTYPES) { (void)snprintf(tbuf, sizeof(tbuf), "type %d", mp->type); @@ -69,13 +70,14 @@ print_request(const char *cp, CTL_MSG *mp) } else tp = types[mp->type]; syslog(LOG_DEBUG, "%s: %s: id %lu, l_user %s, r_user %s, r_tty %s", - cp, tp, mp->id_num, mp->l_name, mp->r_name, mp->r_tty); + cp, tp, (long)mp->id_num, mp->l_name, mp->r_name, mp->r_tty); } void print_response(const char *cp, CTL_RESPONSE *rp) { - char tbuf[80], *tp, abuf[80], *ap; + const char *tp, *ap; + char tbuf[80], abuf[80]; if (rp->type > NTYPES) { (void)snprintf(tbuf, sizeof(tbuf), "type %d", rp->type); |