Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 15 Apr 2012 16:00:32 +0000 (UTC)
From:      Baptiste Daroussin <bapt@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r234315 - head/usr.sbin/pkg
Message-ID:  <201204151600.q3FG0WuO091441@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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(&note, src, sizeof(Elf_Note));
 		src += sizeof(Elf_Note);
 		if (note.n_type == NT_VERSION)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201204151600.q3FG0WuO091441>