svn commit: r245767 - head/usr.bin/tr

Andrew Turner andrew at FreeBSD.org
Tue Jan 22 05:39:35 UTC 2013


Author: andrew
Date: Tue Jan 22 05:39:34 2013
New Revision: 245767
URL: http://svnweb.freebsd.org/changeset/base/245767

Log:
  When copying the complement of the string loop to WINT_MAX as we are dealing
  with a wint_t. WINT_MAX and WCHAR_MAX are the same on most architectures
  except ARM EABI where wint_t is signed and wchar_t is unsigned.

Modified:
  head/usr.bin/tr/tr.c

Modified: head/usr.bin/tr/tr.c
==============================================================================
--- head/usr.bin/tr/tr.c	Tue Jan 22 04:50:21 2013	(r245766)
+++ head/usr.bin/tr/tr.c	Tue Jan 22 05:39:34 2013	(r245767)
@@ -47,6 +47,7 @@ static const char sccsid[] = "@(#)tr.c	8
 #include <err.h>
 #include <limits.h>
 #include <locale.h>
+#include <stdint.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -267,7 +268,7 @@ endloop:
 		 */
 		s2.str = argv[1];
 		s2.state = NORMAL;
-		for (cnt = 0; cnt < WCHAR_MAX; cnt++) {
+		for (cnt = 0; cnt < WINT_MAX; cnt++) {
 			if (Cflag && !iswrune(cnt))
 				continue;
 			if (cmap_lookup(map, cnt) == OOBCH) {


More information about the svn-src-all mailing list