Displaying 2 results from an estimated 2 matches for "__ctype_inline".
2003 Nov 24
1
[PATCH] fix off-by-one correction in ctypes
...There was an off-by-one correction that wasn't necessary.
# --------------------------------------------
#
diff -Nru a/klibc/include/ctype.h b/klibc/include/ctype.h
--- a/klibc/include/ctype.h Mon Nov 24 15:37:03 2003
+++ b/klibc/include/ctype.h Mon Nov 24 15:37:03 2003
@@ -35,13 +35,13 @@
__ctype_inline int isalnum(int __c)
{
- return __ctypes[__c+1] &
+ return __ctypes[__c] &
(__ctype_upper|__ctype_lower|__ctype_digit);
}
__ctype_inline int isalpha(int __c)
{
- return __ctypes[__c+1] &
+ return __ctypes[__c] &
(__ctype_upper|__ctype_lower);
}
@@ -57,48 +57,4...
2003 Nov 11
4
isspace() and other ctype.h functions
..., I'm using klibc in udev and have added some needed functions
(like ftruncate and vsyslog). Should I post the patches here before
commiting them to the cvs tree?
Also, it looks like ctype.h has a off-by-one bug. isspace(' ') returns
0 right now, but if you change the function from:
__ctype_inline int isspace(int __c)
{
return __ctypes[__c+1] & __ctype_space; */
}
to
__ctype_inline int isspace(int __c)
{
return __ctypes[__c] & __ctype_space; */
}
things start working again :)
In looking at the __ctypes[] array, it is 0 based, so all of the +1
array changes in ctype.h sh...