Changeset 3789


Ignore:
Timestamp:
Mar 22, 2012, 9:53:05 PM (13 years ago)
Author:
bird
Message:

ctype.h: Correctly fend of queries reading EOF (-1). Fixes #199.

Location:
branches/libc-0.6/src/emx
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/libc-0.6/src/emx/include/_ctype.h

    r2537 r3789  
    166166static __inline__ unsigned __ctype(__ct_rune_t __ch, unsigned __f)
    167167{
    168     return __ch < 256 && __ch >= -128
     168    return __ch < 256 && __ch >= -128 && __ch != -1 /*EOF*/
    169169        ? __libc_GLocaleCtype.aufType[__ch & 0xff] & __f
    170170        : 0;
     
    178178static __inline__ int __isctype(__ct_rune_t __ch, unsigned __f)
    179179{
    180     return __ch <= 255 && __ch >= -128
     180    return __ch <= 255 && __ch >= -128 && __ch != -1 /*EOF*/
    181181        ? !!(__libc_GLocaleCtypeDefault.aufType[__ch & 0xff] & __f)
    182182        : 0;
  • branches/libc-0.6/src/emx/src/lib/locale/locale_ctype.c

    r3019 r3789  
    220220unsigned __ctype(__ct_rune_t __ch, unsigned __f)
    221221{
    222     return __ch <= 255 && __ch >= -128
     222    return __ch <= 255 && __ch >= -128 && __ch != -1 /*EOF*/
    223223        ? __libc_GLocaleCtype.aufType[__ch & 0xff] & __f
    224224        : 0;
Note: See TracChangeset for help on using the changeset viewer.