summaryrefslogtreecommitdiff
path: root/source/q_shared.c
diff options
context:
space:
mode:
authorAndrey Nazarov <skuller@skuller.net>2007-11-25 20:57:50 +0000
committerAndrey Nazarov <skuller@skuller.net>2007-11-25 20:57:50 +0000
commitb00e7bd024285970dd00cfc75d8e690bfa475501 (patch)
tree22ceeee3027fd4872f5621650557bc8ae4391948 /source/q_shared.c
parent5eaaac93ad3b0d2777815717059d977912bd96f7 (diff)
Changed Com_sprintf --> Q_concat in quite some cases.
Make sure WAVE sound driver is built by default. Added --disable-wave option to `configure'. Command line history is now remembered between sessions. ALT+Space refreshes all servers in Server Browser. Handle command line agruments like original Q2 engine did.
Diffstat (limited to 'source/q_shared.c')
-rw-r--r--source/q_shared.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/source/q_shared.c b/source/q_shared.c
index 6b4a61b..150c95e 100644
--- a/source/q_shared.c
+++ b/source/q_shared.c
@@ -873,6 +873,16 @@ qboolean COM_IsNumeric( const char *string ) {
}
+qboolean COM_HasSpaces( const char *string ) {
+ while( *string ) {
+ if( *string <= 32 ) {
+ return qtrue;
+ }
+ string++;
+ }
+ return qfalse;
+}
+
/* Parses hexadecimal number until it encounters
* illegible symbol or end of string.
* Does not check for overflow.
@@ -1858,6 +1868,32 @@ int Q_strcat( char *dest, int destsize, const char *src ) {
/*
===============
+Q_concat
+===============
+*/
+int Q_concat( char *buffer, int size, ... ) {
+ va_list argptr;
+ const char *s;
+ int len, total = 0;
+
+ va_start( argptr, size );
+ while( ( s = va_arg( argptr, const char * ) ) != NULL ) {
+ len = strlen( s );
+ if( total + len >= size ) {
+ break;
+ }
+ memcpy( buffer + total, s, len );
+ total += len;
+ }
+ va_end( argptr );
+
+ buffer[total] = 0;
+ return total;
+}
+
+
+/*
+===============
Q_vsnprintf
Safe implementation of vsnprintf supposed to