aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--jim-aio.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/jim-aio.c b/jim-aio.c
index 21a16d2..2de776f 100644
--- a/jim-aio.c
+++ b/jim-aio.c
@@ -1028,6 +1028,10 @@ static int JimAioSockCommand(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
hdlfmt = "aio.sock%ld";
+ if (argc > 2) {
+ hostportarg = Jim_GetString(argv[2], NULL);
+ }
+
switch (socktype) {
case SOCK_DGRAM_CLIENT:
if (argc == 2) {
@@ -1049,8 +1053,6 @@ static int JimAioSockCommand(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
goto wrongargs;
}
- hostportarg = Jim_GetString(argv[2], NULL);
-
if (ipv6) {
if (JimParseIPv6Address(interp, hostportarg, &sa, &salen) != JIM_OK) {
return JIM_ERR;
@@ -1083,8 +1085,6 @@ static int JimAioSockCommand(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
goto wrongargs;
}
- hostportarg = Jim_GetString(argv[2], NULL);
-
if (ipv6) {
if (JimParseIPv6Address(interp, hostportarg, &sa, &salen) != JIM_OK) {
return JIM_ERR;