From owner-svn-src-projects@FreeBSD.ORG Sat May 30 18:12:15 2015 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D402231E; Sat, 30 May 2015 18:12:15 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A7ED01127; Sat, 30 May 2015 18:12:15 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4UICFTE038380; Sat, 30 May 2015 18:12:15 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4UICF1H038379; Sat, 30 May 2015 18:12:15 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201505301812.t4UICF1H038379@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 30 May 2015 18:12:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r283780 - projects/clang-trunk/lib/libfetch X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 May 2015 18:12:15 -0000 Author: dim Date: Sat May 30 18:12:14 2015 New Revision: 283780 URL: https://svnweb.freebsd.org/changeset/base/283780 Log: Tentatively fix a few libfetch warnings, see this review for the details: https://reviews.freebsd.org/D2673 Modified: projects/clang-trunk/lib/libfetch/http.c Modified: projects/clang-trunk/lib/libfetch/http.c ============================================================================== --- projects/clang-trunk/lib/libfetch/http.c Sat May 30 18:10:43 2015 (r283779) +++ projects/clang-trunk/lib/libfetch/http.c Sat May 30 18:12:14 2015 (r283780) @@ -1625,10 +1625,8 @@ http_request_body(struct url *URL, const http_auth_params_t aparams; init_http_auth_params(&aparams); if (*purl->user || *purl->pwd) { - aparams.user = purl->user ? - strdup(purl->user) : strdup(""); - aparams.password = purl->pwd? - strdup(purl->pwd) : strdup(""); + aparams.user = strdup(purl->user); + aparams.password = strdup(purl->pwd); } else if ((p = getenv("HTTP_PROXY_AUTH")) != NULL && *p != '\0') { if (http_authfromenv(p, &aparams) < 0) { @@ -1654,10 +1652,8 @@ http_request_body(struct url *URL, const http_auth_params_t aparams; init_http_auth_params(&aparams); if (*url->user || *url->pwd) { - aparams.user = url->user ? - strdup(url->user) : strdup(""); - aparams.password = url->pwd ? - strdup(url->pwd) : strdup(""); + aparams.user = strdup(url->user); + aparams.password = strdup(url->pwd); } else if ((p = getenv("HTTP_AUTH")) != NULL && *p != '\0') { if (http_authfromenv(p, &aparams) < 0) { @@ -1666,10 +1662,8 @@ http_request_body(struct url *URL, const } } else if (fetchAuthMethod && fetchAuthMethod(url) == 0) { - aparams.user = url->user ? - strdup(url->user) : strdup(""); - aparams.password = url->pwd ? - strdup(url->pwd) : strdup(""); + aparams.user = strdup(url->user); + aparams.password = strdup(url->pwd); } else { http_seterr(HTTP_NEED_AUTH); goto ouch;