mirror of
https://github.com/ioquake/ioq3.git
synced 2024-11-10 07:11:46 +00:00
Support Unicode characters greater than 0xFF in cl_consoleKeys
Unrelated: make '0x' value be -1 (invalid) instead of 0. Reported by MAN-AT-ARMS.
This commit is contained in:
parent
00c3480938
commit
0d6edd227a
2 changed files with 5 additions and 6 deletions
|
@ -660,15 +660,15 @@ Com_HexStrToInt
|
|||
*/
|
||||
int Com_HexStrToInt( const char *str )
|
||||
{
|
||||
if ( !str || !str[ 0 ] )
|
||||
if ( !str )
|
||||
return -1;
|
||||
|
||||
// check for hex code
|
||||
if( str[ 0 ] == '0' && str[ 1 ] == 'x' )
|
||||
if( str[ 0 ] == '0' && str[ 1 ] == 'x' && str[ 2 ] != '\0' )
|
||||
{
|
||||
int i, n = 0;
|
||||
int i, n = 0, len = strlen( str );
|
||||
|
||||
for( i = 2; i < strlen( str ); i++ )
|
||||
for( i = 2; i < len; i++ )
|
||||
{
|
||||
char digit;
|
||||
|
||||
|
|
|
@ -138,7 +138,6 @@ static qboolean IN_IsConsoleKey( keyNum_t key, int character )
|
|||
if( !token[ 0 ] )
|
||||
break;
|
||||
|
||||
if( strlen( token ) == 4 )
|
||||
charCode = Com_HexStrToInt( token );
|
||||
|
||||
if( charCode > 0 )
|
||||
|
|
Loading…
Reference in a new issue