Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libc/regex make othercase() return int rather than char, ...



details:   https://anonhg.NetBSD.org/src/rev/78b7ec2893b0
branches:  trunk
changeset: 570038:78b7ec2893b0
user:      jdolecek <jdolecek%NetBSD.org@localhost>
date:      Sat Sep 18 11:47:37 2004 +0000

description:
make othercase() return int rather than char, to avoid sign extension
bug with character codes >= 128

fixes PR lib/26986 by Alexander Becher

diffstat:

 lib/libc/regex/regcomp.c |  10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diffs (39 lines):

diff -r f0df0dde905b -r 78b7ec2893b0 lib/libc/regex/regcomp.c
--- a/lib/libc/regex/regcomp.c  Sat Sep 18 11:41:08 2004 +0000
+++ b/lib/libc/regex/regcomp.c  Sat Sep 18 11:47:37 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: regcomp.c,v 1.18 2003/08/07 16:43:20 agc Exp $ */
+/*     $NetBSD: regcomp.c,v 1.19 2004/09/18 11:47:37 jdolecek Exp $    */
 
 /*-
  * Copyright (c) 1992, 1993, 1994
@@ -76,7 +76,7 @@
 #if 0
 static char sccsid[] = "@(#)regcomp.c  8.5 (Berkeley) 3/20/94";
 #else
-__RCSID("$NetBSD: regcomp.c,v 1.18 2003/08/07 16:43:20 agc Exp $");
+__RCSID("$NetBSD: regcomp.c,v 1.19 2004/09/18 11:47:37 jdolecek Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -137,7 +137,7 @@
 static void p_b_eclass __P((struct parse *p, cset *cs));
 static char p_b_symbol __P((struct parse *p));
 static char p_b_coll_elem __P((struct parse *p, int endc));
-static char othercase __P((int ch));
+static int othercase __P((int ch));
 static void bothcases __P((struct parse *p, int ch));
 static void ordinary __P((struct parse *p, int ch));
 static void nonnewline __P((struct parse *p));
@@ -998,9 +998,9 @@
 
 /*
  - othercase - return the case counterpart of an alphabetic
- == static char othercase(int ch);
+ == static int othercase(int ch);
  */
-static char                    /* if no counterpart, return ch */
+static int                     /* if no counterpart, return ch */
 othercase(ch)
 int ch;
 {



Home | Main Index | Thread Index | Old Index