summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThilo Schulz <arny@ats.s.bawue.de>2011-05-15 14:08:03 +0000
committerTim Angus <tim@ngus.net>2013-01-09 22:27:37 +0000
commitc253917e539fa6a6196cdea8f1733b72feb30107 (patch)
tree71f37869dd9aebdd87d4b3f25604cd155ce4f6d3 /src
parent81d3670b5ba3b7e09463a957f9b4879c4a989ddc (diff)
- Remove Q_strrchr(), replace with standard, portable strrchr() - Add strrchr() to bg_lib.c, patch by DevHC
Diffstat (limited to 'src')
-rw-r--r--src/client/cl_main.c2
-rw-r--r--src/qcommon/files.c2
-rw-r--r--src/qcommon/q_shared.c20
-rw-r--r--src/qcommon/q_shared.h1
-rw-r--r--src/server/sv_client.c2
5 files changed, 3 insertions, 24 deletions
diff --git a/src/client/cl_main.c b/src/client/cl_main.c
index c532e175..2507614a 100644
--- a/src/client/cl_main.c
+++ b/src/client/cl_main.c
@@ -1018,7 +1018,7 @@ void CL_PlayDemo_f( void ) {
CL_Disconnect( qtrue );
// check for an extension .DEMOEXT_?? (?? is protocol)
- ext_test = Q_strrchr(arg, '.');
+ ext_test = strrchr(arg, '.');
if(ext_test && !Q_stricmpn(ext_test + 1, DEMOEXT, ARRAY_LEN(DEMOEXT) - 1))
{
diff --git a/src/qcommon/files.c b/src/qcommon/files.c
index 62edf997..41510fec 100644
--- a/src/qcommon/files.c
+++ b/src/qcommon/files.c
@@ -1000,7 +1000,7 @@ qboolean FS_IsDemoExt(const char *filename, int namelen)
char *ext_test;
int index, protocol;
- ext_test = Q_strrchr(filename, '.');
+ ext_test = strrchr(filename, '.');
if(ext_test && !Q_stricmpn(ext_test + 1, DEMOEXT, ARRAY_LEN(DEMOEXT) - 1))
{
protocol = atoi(ext_test + ARRAY_LEN(DEMOEXT));
diff --git a/src/qcommon/q_shared.c b/src/qcommon/q_shared.c
index b4846799..ba0c5ffe 100644
--- a/src/qcommon/q_shared.c
+++ b/src/qcommon/q_shared.c
@@ -684,26 +684,6 @@ int Q_isalpha( int c )
return ( 0 );
}
-char* Q_strrchr( const char* string, int c )
-{
- char cc = c;
- char *s;
- char *sp=(char *)0;
-
- s = (char*)string;
-
- while (*s)
- {
- if (*s == cc)
- sp = s;
- s++;
- }
- if (cc == 0)
- sp = s;
-
- return sp;
-}
-
qboolean Q_isanumber( const char *s )
{
char *p;
diff --git a/src/qcommon/q_shared.h b/src/qcommon/q_shared.h
index a8da077d..2002bcc9 100644
--- a/src/qcommon/q_shared.h
+++ b/src/qcommon/q_shared.h
@@ -794,7 +794,6 @@ int Q_strncmp (const char *s1, const char *s2, int n);
int Q_stricmpn (const char *s1, const char *s2, int n);
char *Q_strlwr( char *s1 );
char *Q_strupr( char *s1 );
-char *Q_strrchr( const char* string, int c );
const char *Q_stristr( const char *s, const char *find);
// buffer size safe library replacements
diff --git a/src/server/sv_client.c b/src/server/sv_client.c
index 36c5e711..8d69ba8e 100644
--- a/src/server/sv_client.c
+++ b/src/server/sv_client.c
@@ -650,7 +650,7 @@ void SV_WriteDownloadToClient( client_t *cl , msg_t *msg )
{
// Chop off filename extension.
Com_sprintf(pakbuf, sizeof(pakbuf), "%s", cl->downloadName);
- pakptr = Q_strrchr(pakbuf, '.');
+ pakptr = strrchr(pakbuf, '.');
if(pakptr)
{