summaryrefslogtreecommitdiff
path: root/zwgc
diff options
context:
space:
mode:
authorGravatar Karl Ramm <kcr@mit.edu>2009-03-20 05:39:22 +0000
committerGravatar Karl Ramm <kcr@mit.edu>2009-03-20 05:39:22 +0000
commit6e1ad1b28db42231f6ca33161dc8ef37524f5e3b (patch)
tree993263884c415acc6c5d490c36cd81ff214a48bf /zwgc
parent00893ec15a4391092977c9162ec0f5f7eec46a04 (diff)
mild braindeath
Diffstat (limited to 'zwgc')
-rw-r--r--zwgc/character_class.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/zwgc/character_class.c b/zwgc/character_class.c
index 7f81347..41716cb 100644
--- a/zwgc/character_class.c
+++ b/zwgc/character_class.c
@@ -32,12 +32,14 @@ static character_class cache;
char *
string_to_character_class(string str)
{
- int i;
+ int i, l;
(void) memset(cache, 0, sizeof(cache));
- for (i=0; i<strlen(str); i++)
- cache[(int)(unsigned char)str[i]] = 1;
+ l = strlen(str);
+
+ for (i = 0; i < l; i++)
+ cache[(unsigned char)str[i]] = 1;
return(cache);
}