]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
maint: tr: tweak/make-consistent a pair of loop indices
authorJim Meyering <meyering@fb.com>
Fri, 25 Sep 2015 01:28:16 +0000 (18:28 -0700)
committerJim Meyering <meyering@fb.com>
Tue, 30 Aug 2016 14:57:21 +0000 (07:57 -0700)
* src/tr.c (unquote): Use indices of type "unsigned int", rather
than a mix or "size_t" and "int", presuming that no command-line-
specified string will have length longer than UINT_MAX.

src/tr.c

index 05918c44245ff7e1cfc33117e0bb9c700abb7dea..ebb0e47fea11352fc7e6990b0091f664b403877b 100644 (file)
--- a/src/tr.c
+++ b/src/tr.c
@@ -436,8 +436,8 @@ unquote (char const *s, struct E_string *es)
   es->s = xmalloc (len);
   es->escaped = xcalloc (len, sizeof es->escaped[0]);
 
-  size_t j = 0;
-  for (int i = 0; s[i]; i++)
+  unsigned int j = 0;
+  for (unsigned int i = 0; s[i]; i++)
     {
       unsigned char c;
       int oct_digit;