# HG changeset patch # User rbultje # Date 1219517356 0 # Node ID b9c1bcc6c1ca492a95c4604d932954028e5ba422 # Parent 8d267b43eaba04bdf8ceddcb3543c40b4148fd15 On failure, return directly because the fail: case does nothing. This also allows easier control of the actual return value. diff -r 8d267b43eaba -r b9c1bcc6c1ca tcp.c --- a/tcp.c Sat Aug 23 18:46:30 2008 +0000 +++ b/tcp.c Sat Aug 23 18:49:16 2008 +0000 @@ -46,20 +46,21 @@ url_split(proto, sizeof(proto), NULL, 0, hostname, sizeof(hostname), &port, path, sizeof(path), uri); - if (strcmp(proto,"tcp")) goto fail; + if (strcmp(proto,"tcp")) + return AVERROR(EINVAL); if ((q = strchr(hostname,'@'))) { strcpy(tmp,q+1); strcpy(hostname,tmp); } if (port <= 0 || port >= 65536) - goto fail; + return AVERROR(EINVAL); dest_addr.sin_family = AF_INET; dest_addr.sin_port = htons(port); if (resolve_host(&dest_addr.sin_addr, hostname) < 0) - goto fail; + return AVERROR(EIO); fd = socket(AF_INET, SOCK_STREAM, 0); if (fd < 0) - goto fail; + return AVERROR(EIO); ff_socket_nonblock(fd, 1); redo: