summaryrefslogtreecommitdiff
path: root/lib/ZOpenPort.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ZOpenPort.c')
-rw-r--r--lib/ZOpenPort.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/ZOpenPort.c b/lib/ZOpenPort.c
index 9785291..d809c7c 100644
--- a/lib/ZOpenPort.c
+++ b/lib/ZOpenPort.c
@@ -44,7 +44,7 @@ Code_t ZOpenPort(port)
do {
if ((retval = bind(__Zephyr_fd,&bindin,sizeof(bindin))) < 0) {
if (errno == EADDRINUSE) {
- if (port)
+ if (port && *port)
return (ZERR_PORTINUSE);
else
/*NOSTRICT*/
@@ -55,7 +55,7 @@ Code_t ZOpenPort(port)
else
return (errno);
}
- } while (retval < 0 && port);
+ } while (retval < 0 && (!port || !*port));
__Zephyr_port = bindin.sin_port;
__Zephyr_open = 1;