diff options
author | /dev/humancontroller <devhc@example.com> | 2014-07-13 19:00:45 +0200 |
---|---|---|
committer | /dev/humancontroller <devhc@example.com> | 2017-03-09 13:51:12 +0100 |
commit | 9abedc8d181e5c460a88e62809f746abf0f8a8c5 (patch) | |
tree | 67f120e451a0186333f27c46219b9482c1848b63 | |
parent | e019c8c6bcd796fbd1aeef9e28f4e3df546a9b58 (diff) |
make strrchr() and strchr() standard-conformant
-rw-r--r-- | src/game/bg_lib.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/game/bg_lib.c b/src/game/bg_lib.c index bb12f286..4f9ee094 100644 --- a/src/game/bg_lib.c +++ b/src/game/bg_lib.c @@ -269,7 +269,7 @@ char *strrchr( const char *string, int c ) int i, length = strlen( string ); char *p; - for( i = length - 1; i >= 0; i-- ) + for( i = length /*sic*/; i >= 0; i-- ) { p = (char *)&string[ i ]; @@ -289,7 +289,7 @@ char *strchr( const char *string, int c ) string++; } - return (char *)0; + return c == '\0' ? (char *)string : (char *)0; } char *strstr( const char *string, const char *strCharSet ) |