From owner-svn-src-head@FreeBSD.ORG Fri Nov 2 07:49:34 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2BCDB537; Fri, 2 Nov 2012 07:49:34 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (garage.dawidek.net [91.121.88.72]) by mx1.freebsd.org (Postfix) with ESMTP id 218468FC08; Fri, 2 Nov 2012 07:49:33 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id 8D6D0408; Fri, 2 Nov 2012 08:47:56 +0100 (CET) Date: Fri, 2 Nov 2012 08:50:16 +0100 From: Pawel Jakub Dawidek To: Alfred Perlstein Subject: Re: svn commit: r242439 - in head/sys: dev/null geom kern sys Message-ID: <20121102075016.GH1399@garage.freebsd.pl> References: <201211011701.qA1H15fb036810@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="J/zg8ciPNcraoWb6" Content-Disposition: inline In-Reply-To: <201211011701.qA1H15fb036810@svn.freebsd.org> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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: Fri, 02 Nov 2012 07:49:34 -0000 --J/zg8ciPNcraoWb6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Nov 01, 2012 at 05:01:05PM +0000, Alfred Perlstein wrote: > + strlcpy(dumpdevname, devname, sizeof(dumpdevname)); > + if (strlen(dumpdevname) !=3D strlen(devname)) { > + printf("set_dumper: device name truncated from '%s' -> '%s'\n", > + devname, dumpdevname); > + } More "standard" way to check this is the following: if (strlcpy(dumpdevname, devname, sizeof(dumpdevname)) >=3D sizeof(dumpdevname)) { printf("set_dumper: device name truncated from '%s' -> '%s'\n", devname, dumpdevname); } --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --J/zg8ciPNcraoWb6 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlCTezcACgkQForvXbEpPzTx7ACgnrILt6f0uPGzrfl/F8aLpoC7 VbMAoIoeu3hV4f8uAaBflYHLurwJM8vG =49tL -----END PGP SIGNATURE----- --J/zg8ciPNcraoWb6--