tweak the last commit: when parsing peer-ids we don't want locales to postentially change the behavior of isalpha/isdigit/etc

This commit is contained in:
Charles Kerr 2008-04-29 17:23:33 +00:00
parent a362df0a14
commit e18414ad0b
2 changed files with 6 additions and 6 deletions

View File

@ -36,9 +36,9 @@
static int
charint( char ch )
{
if( isdigit( ch ) ) return ch - '0';
if( isupper( ch ) ) return 10 + ch - 'A';
if( islower( ch ) ) return 36 + ch - 'a';
if( '0' <= ch && ch <= '9' ) return ch - '0';
if( 'A' <= ch && ch <= 'Z' ) return 10 + ch - 'A';
if( 'a' <= ch && ch <= 'z' ) return 36 + ch - 'a';
return 0;
}

View File

@ -841,9 +841,9 @@ generateKeyParam( char * msg, int len )
static int
is_rfc2396_alnum( char ch )
{
return ( (ch >= 'a' && ch <= 'z' )
|| (ch >= 'A' && ch <= 'Z' )
|| (ch >= '0' && ch <= '9' ) );
return ( '0' <= ch && ch <= '9' )
|| ( 'A' <= ch && ch <= 'Z' )
|| ( 'a' <= ch && ch <= 'z' );
}
static void