summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2003-12-02 17:58:24 +0000
committerEric Andersen <andersen@codepoet.org>2003-12-02 17:58:24 +0000
commita2fa33e700e2b089d7aebd03615116688603d83a (patch)
tree1705eb1ea3e2f7dbb51a897064c8742706bd1e63
parent805d9be9abf1e7dd15243a6f21825ef24de6177e (diff)
Avoid a potentially undefined operation with a veriable++ in a macro
-rw-r--r--libc/inet/rpc/bindresvport.c4
1 files changed, 2 insertions, 2 deletions
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;
}