add: host = Tcl_GetString(objv[first]); if (*host == 0) { badhost: Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), "invalid hostname: must not be empty", NULL); return TCL_ERROR; }
context: NsTclSockOpenObjCmd(ClientData arg, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]){    SOCKET sock;    int port;    int timeout;    int first;    int async;    if (objc < 3 || objc > 5) {        Tcl_WrongNumArgs(interp, 1, objv, "?-nonblock|-timeout seconds? host port");        return TCL_ERROR;    }    first = 1;    async = 0;    timeout = -1;    if (objc == 4) {	/*	 * open -nonblock host port	 */	        if (!STREQ(Tcl_GetString(objv[1]), "-nonblock") && 	    !STREQ(Tcl_GetString(objv[1]), "-async")) {	    Tcl_WrongNumArgs(interp, 1, objv, "?-nonblock|-timeout seconds? host port");	   return TCL_ERROR;        }        first = 2;        async = 1;    } else if (objc == 5) {	/*	 * open -timeout seconds host port	 */        if (!STREQ(Tcl_GetString(objv[1]), "-timeout")) {        	Tcl_WrongNumArgs(interp, 1, objv, "?-nonblock|-timeout seconds? host port");	    	return TCL_ERROR;        }        if (Tcl_GetIntFromObj(interp, objv[2], &timeout) != TCL_OK) {            return TCL_ERROR;        }        first = 3;    }    if (Tcl_GetIntFromObj(interp, objv[first + 1], &port) != TCL_OK) {        return TCL_ERROR;    }    /*     * Perform the connection.     */        if (async) {        sock = Ns_SockAsyncConnect(Tcl_GetString(objv[first]), port);    } else if (timeout < 0) {        sock = Ns_SockConnect(Tcl_GetString(objv[first]), port);    } else {        sock = Ns_SockTimedConnect(Tcl_GetString(objv[first]), port, timeout);    }    if (sock == INVALID_SOCKET) {	Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), "could not connect to \"",		Tcl_GetString(objv[first]), ":", 		Tcl_GetString(objv[first + 1]), "\"", NULL);        return TCL_ERROR;    }    return EnterDupedSocks(interp, sock);}