diff options
author | Andrey Nazarov <skuller@skuller.net> | 2007-12-20 18:28:37 +0000 |
---|---|---|
committer | Andrey Nazarov <skuller@skuller.net> | 2007-12-20 18:28:37 +0000 |
commit | a33a790492ae722314521cd0f5c6c58c13c5fbd4 (patch) | |
tree | 564ce1d523798e4cf4fe8bfb5adee9b2cf252935 /source/q_shared.c | |
parent | 0817feeab90886b7c4379bc9fa54f67154c40172 (diff) |
Added initial server side support for r1ch.net anticheat.
Renamed `listban' command to `listbans'.
Make sure NET_Connect sets NS_CONNECTING state even if
connect() succeedes immediately.
Changed FIFO_Read/FIFO_Write semantics.
Diffstat (limited to 'source/q_shared.c')
-rw-r--r-- | source/q_shared.c | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/source/q_shared.c b/source/q_shared.c index 4a6703e..4b4a519 100644 --- a/source/q_shared.c +++ b/source/q_shared.c @@ -886,28 +886,18 @@ qboolean COM_HasSpaces( const char *string ) { * illegible symbol or end of string. * Does not check for overflow. */ -uint32 COM_ParseHex( const char *string ) { - int ch; - uint32 result, digit; - - result = 0; - while( *string ) { - ch = *string++; - if( ch >= '0' && ch <= '9' ) { - digit = ch - '0'; - } else if( ch >= 'a' && ch <= 'f' ) { - digit = ch - 'a' + 10; - } else if( ch >= 'A' && ch <= 'F' ) { - digit = ch - 'A' + 10; - } else { - break; - } +uint32 COM_ParseHex( const char *s ) { + int c; + uint32 result; - result = digit | ( result << 4 ); + for( result = 0; *s; s++ ) { + if( ( c = Q_charhex( *s ) ) == -1 ) { + break; + } + result = c | ( result << 4 ); } return result; - } /* |