From 8bc84bd9466c8a43f4873b73a3674448020761d5 Mon Sep 17 00:00:00 2001
From: rswindell <>
Date: Wed, 25 May 2005 22:21:10 +0000
Subject: [PATCH] aftol() no longer modifies the string passed to it.

---
 src/sbbs3/scfglib2.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/src/sbbs3/scfglib2.c b/src/sbbs3/scfglib2.c
index d85100a647..5232ba8340 100644
--- a/src/sbbs3/scfglib2.c
+++ b/src/sbbs3/scfglib2.c
@@ -844,13 +844,12 @@ char *readline(long *offset, char *outstr, int maxlen, FILE *instream)
 /****************************************************************************/
 long aftol(char *str)
 {
-	int		c=0;
+	size_t	c=0;
 	ulong	l=0UL;
 
-	strupr(str);
 	while(str[c]) {
-		if(str[c]>='A' && str[c]<='Z')
-			l|=FLAG(str[c]);
+		if(toupper(str[c])>='A' && toupper(str[c])<='Z')
+			l|=FLAG(toupper(str[c]));
 		c++; 
 	}
 	return(l);
@@ -861,7 +860,7 @@ long aftol(char *str)
 /*****************************************************************************/
 char *ltoaf(long l,char *str)
 {
-	int		c=0;
+	size_t	c=0;
 
 	while(c<26) {
 		if(l&(long)(1L<<c))
-- 
GitLab