From: sajt Date: Tue, 9 Oct 2007 19:50:26 +0000 (+0000) Subject: i'm sure there are plenty of bugs here for you guys to fix X-Git-Tag: xonotic-v0.1.0preview~2862 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=2942e1d5fa49af36df6611b9d43f819d2de95ee5;p=xonotic%2Fdarkplaces.git i'm sure there are plenty of bugs here for you guys to fix git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7616 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/prvm_cmds.c b/prvm_cmds.c index 6276252c..abb553a5 100644 --- a/prvm_cmds.c +++ b/prvm_cmds.c @@ -1905,7 +1905,7 @@ void VM_strreplace(void) for (j = 0; j < search_len && i+j < subject_len; j++) if (subject[i+j] != search[j]) break; - if (j == search_len) + if (j == search_len || i+j == subject_len) { // found it at offset 'i' for (j = 0; j < replace_len && si < (int)sizeof(string) - 1; j++) @@ -1954,7 +1954,7 @@ void VM_strireplace(void) for (j = 0; j < search_len && i+j < subject_len; j++) if (tolower(subject[i+j]) != tolower(search[j])) break; - if (j == search_len) + if (j == search_len || i+j == subject_len) { // found it at offset 'i' for (j = 0; j < replace_len && si < (int)sizeof(string) - 1; j++)