From: patthoyts Date: Mon, 22 Nov 2004 16:31:25 +0000 (+0000) Subject: Fixed the udp_conf return value. X-Git-Tag: tcludp-1_0_6~2 X-Git-Url: https://privyetmir.co.uk/gitweb.cgi?a=commitdiff_plain;h=7c30e37fd8012b9491533d99ebc26c83ac07e96c;p=tcludp Fixed the udp_conf return value. --- diff --git a/generic/udp_tcl.c b/generic/udp_tcl.c index e2c39ca..e04a244 100644 --- a/generic/udp_tcl.c +++ b/generic/udp_tcl.c @@ -358,41 +358,41 @@ udpConf(ClientData clientData, Tcl_Interp *interp, Tcl_DStringResult(interp, &ds); } Tcl_DStringFree(&ds); - return r; } } else if (argc == 4) { if (!strcmp(argv[2], "-mcastadd")) { - return UdpMulticast(statePtr, interp, argv[3], IP_ADD_MEMBERSHIP); + r = UdpMulticast(statePtr, interp, argv[3], IP_ADD_MEMBERSHIP); } else if (!strcmp(argv[2], "-mcastdrop")) { - return UdpMulticast(statePtr, interp, argv[3], IP_DROP_MEMBERSHIP); + r = UdpMulticast(statePtr, interp, argv[3], IP_DROP_MEMBERSHIP); } else if (!strcmp(argv[2], "-broadcast")) { - return Tcl_SetChannelOption(interp, statePtr->channel, + r = Tcl_SetChannelOption(interp, statePtr->channel, "-broadcast", argv[3]); } else if (!strcmp(argv[2], "-ttl")) { - return Tcl_SetChannelOption(interp, statePtr->channel, + r = Tcl_SetChannelOption(interp, statePtr->channel, "-ttl", argv[3]); } else { if (strlen(argv[2]) >= sizeof(statePtr->remotehost)) { result = "hostname too long"; Tcl_SetResult (interp, result, NULL); - return TCL_ERROR; - } - strcpy(statePtr->remotehost, argv[2]); - return udpGetService(interp, argv[3], &(statePtr->remoteport)); + r = TCL_ERROR; + } else { + strcpy(statePtr->remotehost, argv[2]); + r = udpGetService(interp, argv[3], &(statePtr->remoteport)); + } } } else { Tcl_SetResult (interp, errmsg, NULL); - return TCL_ERROR; + r = TCL_ERROR; } - return TCL_ERROR; + return r; } /*