diff options
author | Eric Andersen <andersen@codepoet.org> | 2003-12-02 17:58:24 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2003-12-02 17:58:24 +0000 |
commit | a2fa33e700e2b089d7aebd03615116688603d83a (patch) | |
tree | 1705eb1ea3e2f7dbb51a897064c8742706bd1e63 /libc/inet | |
parent | 805d9be9abf1e7dd15243a6f21825ef24de6177e (diff) |
Avoid a potentially undefined operation with a veriable++ in a macro
Diffstat (limited to 'libc/inet')
-rw-r--r-- | libc/inet/rpc/bindresvport.c | 4 |
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; } |