Add missing #include <stdio.h>.

Fix an off-by-one error in logit() when determining if a procedure
number has a known name.
This commit is contained in:
Ian Dowse 2001-07-14 17:10:58 +00:00
parent e8418b515c
commit 05c4b26e95
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=79721

View File

@ -10,6 +10,7 @@
#include <rpc/rpcb_prot.h>
#include <rpc/pmap_prot.h>
#include <err.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
@ -201,7 +202,7 @@ logit(int severity, struct sockaddr *addr, rpcproc_t procnum, rpcprog_t prognum,
/* Try to map procedure number to name. */
if (procnum > (sizeof procmap / sizeof (char *))) {
if (procnum >= (sizeof procmap / sizeof (char *))) {
snprintf(procbuf, sizeof procbuf, "%u",
(unsigned)procnum);
procname = procbuf;