From owner-svn-src-all@FreeBSD.ORG Sun Apr 15 16:00:33 2012 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 0519A1065670; Sun, 15 Apr 2012 16:00:33 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E35368FC08; Sun, 15 Apr 2012 16:00:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3FG0Wpb091443; Sun, 15 Apr 2012 16:00:32 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3FG0WuO091441; Sun, 15 Apr 2012 16:00:32 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201204151600.q3FG0WuO091441@svn.freebsd.org> From: Baptiste Daroussin Date: Sun, 15 Apr 2012 16:00:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234315 - head/usr.sbin/pkg 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: Sun, 15 Apr 2012 16:00:33 -0000 Author: bapt Date: Sun Apr 15 16:00:32 2012 New Revision: 234315 URL: http://svn.freebsd.org/changeset/base/234315 Log: Do not do double initialisation style(9) says for (;;) not while (1) Reported by: culot Approved by: des Modified: head/usr.sbin/pkg/pkg.c Modified: head/usr.sbin/pkg/pkg.c ============================================================================== --- head/usr.sbin/pkg/pkg.c Sun Apr 15 15:15:16 2012 (r234314) +++ head/usr.sbin/pkg/pkg.c Sun Apr 15 16:00:32 2012 (r234315) @@ -56,7 +56,7 @@ __FBSDID("$FreeBSD$"); static const char * elf_corres_to_string(struct _elf_corres* m, int e) { - int i = 0; + int i; for (i = 0; m[i].string != NULL; i++) if (m[i].elf_nb == e) @@ -125,7 +125,7 @@ pkg_get_myabi(char *dest, size_t sz) data = elf_getdata(scn, NULL); src = data->d_buf; - while (1) { + for (;;) { memcpy(¬e, src, sizeof(Elf_Note)); src += sizeof(Elf_Note); if (note.n_type == NT_VERSION)