summaryrefslogtreecommitdiff
path: root/src/qcommon
diff options
context:
space:
mode:
authorZack Middleton <zturtleman@gmail.com>2014-06-17 21:28:22 -0500
committerTim Angus <tim@ngus.net>2014-08-28 11:03:33 +0100
commit6a7af725d6f857b961ebf888f5156d771067f97d (patch)
treec98d985b006d4d63e2cff8729116f999e6b3591c /src/qcommon
parentc3d4d0aa93f114b1d3ec92312d1c1f4e6e929e0d (diff)
Fix SkipRestOfLine going past end of string
If string data starts with a 0 (string terminator), don't skip over it at p++. Not causing any problems in ioq3 as far as I know.
Diffstat (limited to 'src/qcommon')
-rw-r--r--src/qcommon/q_shared.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/qcommon/q_shared.c b/src/qcommon/q_shared.c
index 2c5d76d1..f226603d 100644
--- a/src/qcommon/q_shared.c
+++ b/src/qcommon/q_shared.c
@@ -601,6 +601,10 @@ void SkipRestOfLine ( char **data ) {
int c;
p = *data;
+
+ if ( !*p )
+ return;
+
while ( (c = *p++) != 0 ) {
if ( c == '\n' ) {
com_lines++;