Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 9 Sep 2019 20:04:46 +0000 (UTC)
From:      Ed Maste <emaste@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r352106 - stable/12/usr.bin/ar
Message-ID:  <201909092004.x89K4kvA078789@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: emaste
Date: Mon Sep  9 20:04:45 2019
New Revision: 352106
URL: https://svnweb.freebsd.org/changeset/base/352106

Log:
  MFC r351663: ar: use more correct size_t type for loop index
  
  Submitted by:	cem

Modified:
  stable/12/usr.bin/ar/write.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/usr.bin/ar/write.c
==============================================================================
--- stable/12/usr.bin/ar/write.c	Mon Sep  9 19:58:46 2019	(r352105)
+++ stable/12/usr.bin/ar/write.c	Mon Sep  9 20:04:45 2019	(r352106)
@@ -615,9 +615,9 @@ write_objs(struct bsdar *bsdar)
 	size_t s_sz;		/* size of archive symbol table. */
 	size_t pm_sz;		/* size of pseudo members */
 	size_t w_sz;		/* size of words in symbol table */
+	size_t			 i;
 	uint64_t		 nr;
 	uint32_t		 nr32;
-	int			 i;
 
 	if (elf_version(EV_CURRENT) == EV_NONE)
 		bsdar_errc(bsdar, EX_SOFTWARE, 0,
@@ -671,7 +671,7 @@ write_objs(struct bsdar *bsdar)
 			    bsdar->s_sn_sz;
 			pm_sz += s_sz;
 			/* Convert to big-endian. */
-			for (i = 0; (size_t)i < bsdar->s_cnt; i++)
+			for (i = 0; i < bsdar->s_cnt; i++)
 				bsdar->s_so[i] =
 				    htobe64(bsdar->s_so[i] + pm_sz);
 		} else {
@@ -679,7 +679,7 @@ write_objs(struct bsdar *bsdar)
 			 * Convert to big-endian and shuffle in-place to
 			 * the front of the allocation. XXX UB
 			 */
-			for (i = 0; (size_t)i < bsdar->s_cnt; i++)
+			for (i = 0; i < bsdar->s_cnt; i++)
 				((uint32_t *)(bsdar->s_so))[i] =
 				    htobe32(bsdar->s_so[i] + pm_sz);
 		}



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