Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 27 Nov 2010 00:46:57 +0000 (UTC)
From:      Nathan Whitehorn <nwhitehorn@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r215921 - stable/8/usr.bin/locate/locate
Message-ID:  <201011270046.oAR0kv9i001896@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: nwhitehorn
Date: Sat Nov 27 00:46:57 2010
New Revision: 215921
URL: http://svn.freebsd.org/changeset/base/215921

Log:
  MFC r215752:
  Properly use SCHAR_MAX instead of CHAR_MAX for 0x7f. This fixes operation
  of locate(1) on systems on which char is unsigned by default (ARM and
  PowerPC).
  
  Reported by:	Paul Mather

Modified:
  stable/8/usr.bin/locate/locate/locate.h
Directory Properties:
  stable/8/usr.bin/locate/   (props changed)

Modified: stable/8/usr.bin/locate/locate/locate.h
==============================================================================
--- stable/8/usr.bin/locate/locate/locate.h	Sat Nov 27 00:37:13 2010	(r215920)
+++ stable/8/usr.bin/locate/locate/locate.h	Sat Nov 27 00:46:57 2010	(r215921)
@@ -48,15 +48,15 @@
 #define LDC_MAX        28
 
 /*	128-255 bigram codes (128 most common, as determined by 'updatedb') */
-#define BIGRAM_MIN    (UCHAR_MAX - CHAR_MAX) 
+#define BIGRAM_MIN    (UCHAR_MAX - SCHAR_MAX) 
 #define BIGRAM_MAX    UCHAR_MAX
 
 /*	32-127  single character (printable) ascii residue (ie, literal) */
 #define ASCII_MIN      32
-#define ASCII_MAX     CHAR_MAX
+#define ASCII_MAX     SCHAR_MAX
 
-/* #define TO7BIT(x)     (x = ( ((u_char)x) & CHAR_MAX )) */
-#define TO7BIT(x)     (x = x & CHAR_MAX )
+/* #define TO7BIT(x)     (x = ( ((u_char)x) & SCHAR_MAX )) */
+#define TO7BIT(x)     (x = x & SCHAR_MAX )
 
 
 #if UCHAR_MAX >= 4096



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