From a2fa33e700e2b089d7aebd03615116688603d83a Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Tue, 2 Dec 2003 17:58:24 +0000 Subject: Avoid a potentially undefined operation with a veriable++ in a macro --- libc/inet/rpc/bindresvport.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libc/inet/rpc/bindresvport.c') diff --git a/libc/inet/rpc/bindresvport.c b/libc/inet/rpc/bindresvport.c index 7dcebe7dc..579f17be7 100644 --- a/libc/inet/rpc/bindresvport.c +++ b/libc/inet/rpc/bindresvport.c @@ -76,8 +76,8 @@ bindresvport (int sd, struct sockaddr_in *sin) for (i = 0; i < NPORTS && res < 0 && errno == EADDRINUSE; ++i) { - sin->sin_port = htons (port++); - if (port > ENDPORT) + sin->sin_port = htons (port); + if (++port > ENDPORT) { port = STARTPORT; } -- cgit v1.2.3