From 78cfa165d10a52e45343f56ac5dae28c7cbd5e6b Mon Sep 17 00:00:00 2001 From: divverent Date: Fri, 6 Mar 2009 13:52:20 +0000 Subject: [PATCH] fix token endpos writng by tokenizebyseparator git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8777 d7cf8633-e32d-0410-b094-e92efae38249 --- prvm_cmds.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/prvm_cmds.c b/prvm_cmds.c index b6ec5543..12168dac 100644 --- a/prvm_cmds.c +++ b/prvm_cmds.c @@ -2375,7 +2375,7 @@ void VM_tokenizebyseparator (void) int numseparators; int separatorlen[7]; const char *separators[7]; - const char *p; + const char *p, *p0; const char *token; char tokentext[MAX_INPUTLINE]; @@ -2403,6 +2403,7 @@ void VM_tokenizebyseparator (void) { token = tokentext + j; tokens_startpos[num_tokens] = p - tokenize_string; + p0 = p; while (*p) { for (k = 0;k < numseparators;k++) @@ -2418,8 +2419,9 @@ void VM_tokenizebyseparator (void) if (j < (int)sizeof(tokentext)-1) tokentext[j++] = *p; p++; + p0 = p; } - tokens_endpos[num_tokens] = p - tokenize_string; + tokens_endpos[num_tokens] = p0 - tokenize_string; if (j >= (int)sizeof(tokentext)) break; tokentext[j++] = 0; -- 2.39.2