From d404552454c140d672e18a5cbbebe9d6590a3306 Mon Sep 17 00:00:00 2001
From: Per Cederqvist <ceder@lysator.liu.se>
Date: Wed, 8 Jul 1998 13:57:47 +0000
Subject: [PATCH] (s_strcmp): Changed type of loop variable from "unsigned int"
 to 	"String_size". (s_usr_strcmp): Likewise. (char2digit): Added const
 qualifier to translate_table.  Use an 	int as argument to isalpha and tolower
 to avoid problems with 	signed chars. (rcsid): Added a missing const.

---
 src/libraries/libmisc/s-string.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/src/libraries/libmisc/s-string.c b/src/libraries/libmisc/s-string.c
index 08ca3c5ea..ab22417a1 100644
--- a/src/libraries/libmisc/s-string.c
+++ b/src/libraries/libmisc/s-string.c
@@ -1,5 +1,5 @@
 /*
- * $Id: s-string.c,v 1.19 1996/08/03 01:30:04 ceder Exp $
+ * $Id: s-string.c,v 1.20 1998/07/08 13:57:47 ceder Exp $
  * Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996  Lysator Academic Computer Association.
  *
  * This file is part of the LysKOM server.
@@ -46,7 +46,8 @@
  *  even if so stated.
  */
 
-static char *rcsid = "$Id: s-string.c,v 1.19 1996/08/03 01:30:04 ceder Exp $";
+static const char *
+rcsid = "$Id: s-string.c,v 1.20 1998/07/08 13:57:47 ceder Exp $";
 
 #include <sys/types.h>
 #include <stdio.h>
@@ -468,7 +469,7 @@ s_strcmp (String   str1,
 	  String   str2)
 
 {
-    unsigned int	index;
+    String_size		index;
     String_size		shortest;	/* Length of the shortest string */
     int			retval_based_on_lengths;
 
@@ -524,7 +525,7 @@ s_usr_strcmp (String	 str1,
 	      char     * collat_tab)
 
 {
-    unsigned int	index;
+    String_size		index;
     String_size		shortest;	/* Length of the shortest string */
     int			retval_based_on_lengths;
 
@@ -845,13 +846,14 @@ char2digit (const char	ch,
 	    const int	base)
 {
     int			  index;
-    static  char	* translate_table	=
+    static const char	* translate_table	=
 				"0123456789abcdefghijklmnopqrstuvwxyz";
+    int			  c = (unsigned char)ch;
 
     index = 0;
     while (  (index < base)
 	   && (  translate_table[index]
-	       != (isalpha(ch) ? tolower(ch) : ch)))
+	       != (isalpha(c) ? tolower(c) : ch)))
 	index++;
 
     if (index >= base)
-- 
GitLab