svn commit: r283780 - projects/clang-trunk/lib/libfetch

Dimitry Andric dim at FreeBSD.org
Sat May 30 18:12:15 UTC 2015


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;


More information about the svn-src-projects mailing list