From owner-svn-src-all@FreeBSD.ORG Sat Jan 15 08:37:34 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 50AD41065672; Sat, 15 Jan 2011 08:37:34 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3FBCF8FC0C; Sat, 15 Jan 2011 08:37:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0F8bYAN018422; Sat, 15 Jan 2011 08:37:34 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0F8bYqN018420; Sat, 15 Jan 2011 08:37:34 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201101150837.p0F8bYqN018420@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 15 Jan 2011 08:37:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217441 - stable/8/lib/libc/stdlib X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Jan 2011 08:37:34 -0000 Author: kib Date: Sat Jan 15 08:37:33 2011 New Revision: 217441 URL: http://svn.freebsd.org/changeset/base/217441 Log: MFC r217144: Fix some style(9) issues. Do not use strlcpy() where simple assignment is enough. Modified: stable/8/lib/libc/stdlib/realpath.c Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libc/locale/ (props changed) stable/8/lib/libc/stdtime/ (props changed) stable/8/lib/libc/sys/ (props changed) Modified: stable/8/lib/libc/stdlib/realpath.c ============================================================================== --- stable/8/lib/libc/stdlib/realpath.c Sat Jan 15 08:35:41 2011 (r217440) +++ stable/8/lib/libc/stdlib/realpath.c Sat Jan 15 08:37:33 2011 (r217441) @@ -54,7 +54,7 @@ realpath(const char * __restrict path, c char *p, *q, *s; size_t left_len, resolved_len; unsigned symlinks; - int serrno, slen, m; + int m, serrno, slen; char left[PATH_MAX], next_token[PATH_MAX], symlink[PATH_MAX]; if (path == NULL) { @@ -73,7 +73,6 @@ realpath(const char * __restrict path, c m = 1; } else m = 0; - symlinks = 0; if (path[0] == '/') { resolved[0] = '/'; @@ -86,8 +85,10 @@ realpath(const char * __restrict path, c if (getcwd(resolved, PATH_MAX) == NULL) { if (m) free(resolved); - else - strlcpy(resolved, ".", PATH_MAX); + else { + resolved[0] = '.'; + resolved[1] = '\0'; + } return (NULL); } resolved_len = strlen(resolved);