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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user