libc rpc: Fix mismatches in prototypes for array bounds.

Various RPC functions used a bare pointer in function prototypes to
describe fixed-length buffer arguments but used a fixed-length array
in the function definition.  The manual page for these functions
describes the parameters as being fixed-length buffers, so update
the prototypes to match the definitions.

Reviewed by:	imp, emaste
Reported by:	GCC -Warray-parameter
Differential Revision:	https://reviews.freebsd.org/D36757
This commit is contained in:
John Baldwin 2022-09-28 14:01:36 -07:00
parent 409dae262f
commit a2e41a585b
2 changed files with 7 additions and 6 deletions

View file

@ -279,11 +279,12 @@ __END_DECLS
* Netname manipulation routines.
*/
__BEGIN_DECLS
extern int getnetname(char *);
extern int host2netname(char *, const char *, const char *);
extern int user2netname(char *, const uid_t, const char *);
extern int netname2user(char *, uid_t *, gid_t *, int *, gid_t *);
extern int netname2host(char *, char *, const int);
extern int getnetname(char [MAXNETNAMELEN + 1]);
extern int host2netname(char [MAXNETNAMELEN + 1], const char *, const char *);
extern int user2netname(char [MAXNETNAMELEN + 1], const uid_t, const char *);
extern int netname2user(char [MAXNETNAMELEN + 1], uid_t *, gid_t *, int *,
gid_t *);
extern int netname2host(char [MAXNETNAMELEN + 1], char *, const int);
extern void passwd2des ( char *, char * );
__END_DECLS

View file

@ -64,7 +64,7 @@ static char *NETID = "netid.byname";
static char *NETIDFILE = "/etc/netid";
static int getnetid( char *, char * );
static int _getgroups( char *, gid_t * );
static int _getgroups( char *, gid_t [NGRPS] );
/*
* Convert network-name into unix credential