From owner-svn-src-head@freebsd.org Mon May 15 17:54:37 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D22F5D6E890; Mon, 15 May 2017 17:54:37 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 9FCAB201; Mon, 15 May 2017 17:54:37 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4FHsax1045570; Mon, 15 May 2017 17:54:36 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4FHsaxM045569; Mon, 15 May 2017 17:54:36 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201705151754.v4FHsaxM045569@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 15 May 2017 17:54:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r318303 - head/lib/libc/stdlib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 May 2017 17:54:37 -0000 Author: kib Date: Mon May 15 17:54:36 2017 New Revision: 318303 URL: https://svnweb.freebsd.org/changeset/base/318303 Log: Style. Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/lib/libc/stdlib/realpath.c Modified: head/lib/libc/stdlib/realpath.c ============================================================================== --- head/lib/libc/stdlib/realpath.c Mon May 15 17:51:01 2017 (r318302) +++ head/lib/libc/stdlib/realpath.c Mon May 15 17:54:36 2017 (r318303) @@ -89,7 +89,7 @@ realpath1(const char *path, char *resolv */ p = strchr(left, '/'); - next_token_len = p ? p - left : left_len; + next_token_len = p != NULL ? p - left : left_len; memcpy(next_token, left, next_token_len); next_token[next_token_len] = '\0'; @@ -112,10 +112,9 @@ realpath1(const char *path, char *resolv if (next_token[0] == '\0') { /* Handle consequential slashes. */ continue; - } - else if (strcmp(next_token, ".") == 0) + } else if (strcmp(next_token, ".") == 0) { continue; - else if (strcmp(next_token, "..") == 0) { + } else if (strcmp(next_token, "..") == 0) { /* * Strip the last path component except when we have * single "/" @@ -146,13 +145,12 @@ realpath1(const char *path, char *resolv } slen = readlink(resolved, symlink, sizeof(symlink)); if (slen <= 0 || slen >= sizeof(symlink)) { - if (slen < 0) { - /* keep errno from readlink(2) call */ - } else if (slen == 0) { + if (slen < 0) + ; /* keep errno from readlink(2) call */ + else if (slen == 0) errno = ENOENT; - } else { + else errno = ENAMETOOLONG; - } return (NULL); } symlink[slen] = '\0';