sunrpc: Fix clang build

clang-21 issues:

rtime.c:96:36: error: variable 'thetime' is uninitialized when passed as a const pointer argument here
      [-Werror,-Wuninitialized-const-pointer]
   96 |       res = __sendto (s, (char *) &thetime, sizeof (thetime), 0,
      |                                    ^~~~~~~

For SOCK_DGRAM the sendto sends an uninitialized value.

Reviewed-by: Collin Funk <collin.funk1@gmail.com>
This commit is contained in:
Adhemerval Zanella 2025-10-20 09:27:54 -03:00
parent 0e4ca88bd2
commit 87e850fb26
1 changed files with 1 additions and 1 deletions

View File

@ -75,7 +75,7 @@ rtime (struct sockaddr_in *addrp, struct rpc_timeval *timep,
int milliseconds;
int res;
/* RFC 868 says the time is transmitted as a 32-bit value. */
uint32_t thetime;
uint32_t thetime = 0;
struct sockaddr_in from;
socklen_t fromlen;
int type;