[Scummvm-cvs-logs] CVS: scummvm/scumm string.cpp,1.15,1.16
Pawe? Ko?odziejski
aquadran at users.sourceforge.net
Wed Sep 18 11:49:05 CEST 2002
Update of /cvsroot/scummvm/scummvm/scumm
In directory usw-pr-cvs1:/tmp/cvs-serv12974
Modified Files:
string.cpp
Log Message:
fixed for and added comments
Index: string.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/string.cpp,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- string.cpp 17 Sep 2002 15:33:31 -0000 1.15
+++ string.cpp 18 Sep 2002 18:48:54 -0000 1.16
@@ -1103,7 +1103,7 @@
char enc;
// copy name from text /..../
- for (l = 0; l < 20, *(text + l + 1) != '.'; l++) {
+ for (l = 0; (l < 20) && (*(text + l + 1) != '.'); l++) {
name[l] = *(text + l + 1);
}
name[l] = 0;
@@ -1140,7 +1140,7 @@
pos += 2;
// compare 'name' with above name
if (strcmp(tmp, name) == 0) {
- // get number lines of 'name'
+ // get number lines of 'name' after '#'
l = 0;
if (*(buf + pos++) == '#') {
do {
@@ -1156,15 +1156,18 @@
tmp2[j++] = *(buf + pos++);
} while(*(buf + pos) != '/');
tmp2[j] = 0;
+ // compare if is right line
if (strcmp(tmp2, num_s) == 0) {
k = 0;
pos++;
+ // copy translated text to tran_buffer
do {
*(trans_buff + k++) = (*(buf + pos++)) ^ enc;
} while((*(buf + pos) != 0x0d) && (*(buf + pos + 1) != 0x0a));
*(trans_buff + k) = 0;
return;
}
+ // goto next line
do {
pos++;
} while((*(buf + pos) != 0x0d) && (*(buf + pos + 1) != 0x0a));
More information about the Scummvm-git-logs
mailing list