summaryrefslogtreecommitdiff
path: root/src/qcommon
diff options
context:
space:
mode:
Diffstat (limited to 'src/qcommon')
-rw-r--r--src/qcommon/q_shared.c4
-rw-r--r--src/qcommon/q_shared.h4
2 files changed, 5 insertions, 3 deletions
diff --git a/src/qcommon/q_shared.c b/src/qcommon/q_shared.c
index b930b0ec..d6aa5c90 100644
--- a/src/qcommon/q_shared.c
+++ b/src/qcommon/q_shared.c
@@ -938,7 +938,7 @@ void Q_ParseNewlines( char *dest, const char *src, int destsize )
*dest++ = '\0';
}
-void QDECL Com_sprintf(char *dest, int size, const char *fmt, ...)
+int QDECL Com_sprintf(char *dest, int size, const char *fmt, ...)
{
int len;
va_list argptr;
@@ -949,6 +949,8 @@ void QDECL Com_sprintf(char *dest, int size, const char *fmt, ...)
if(len >= size)
Com_Printf("Com_sprintf: Output length %d too short, require %d bytes.\n", size, len + 1);
+
+ return len;
}
/*
diff --git a/src/qcommon/q_shared.h b/src/qcommon/q_shared.h
index e1533b92..751c342d 100644
--- a/src/qcommon/q_shared.h
+++ b/src/qcommon/q_shared.h
@@ -193,7 +193,7 @@ typedef int clipHandle_t;
#define MIN_QINT (-MAX_QINT-1)
#define ARRAY_LEN(x) (sizeof(x) / sizeof(*(x)))
-
+#define STR_LEN(x) (ARRAY_LEN(x) - 1)
// angle indexes
#define PITCH 0 // up / down
@@ -799,7 +799,7 @@ void Parse2DMatrix (char **buf_p, int y, int x, float *m);
void Parse3DMatrix (char **buf_p, int z, int y, int x, float *m);
int Com_HexStrToInt( const char *str );
-void QDECL Com_sprintf (char *dest, int size, const char *fmt, ...) __attribute__ ((format (printf, 3, 4)));
+int QDECL Com_sprintf (char *dest, int size, const char *fmt, ...) __attribute__ ((format (printf, 3, 4)));
char *Com_SkipTokens( char *s, int numTokens, char *sep );
char *Com_SkipCharset( char *s, char *sep );