977,11 → 977,17 |
char* q2, * tmp_cur_filter_str[29], *token; |
int lineNumber = 0; |
|
if (strstr(q, "FFL1.0") != q) { |
if (count < 6) { |
res = MSG_INVALID_FILE_SIGNATURE_ID; |
} |
else { |
|
char testsig[7]; |
memcpy(testsig, q, 6); // only read 6 chars. Avoid reading the whole file yet |
testsig[6] = '\0'; |
if (strcmp(testsig, "FFL1.0") != 0) { |
res = MSG_INVALID_FILE_SIGNATURE_ID; |
} |
else { |
// This is required to make strtok work, because q is not zero-terminated... |
q2 = (char*)malloc(count + 1/*NUL byte*/); |
if (q2 == NULL) { |
1007,7 → 1013,7 |
} |
*/ |
} |
else if (lineNumber > 1) { |
else if (lineNumber == 1) { |
// We don't check that. We just stop at every 28th line of each filter |
/* |
countFilters = atoi(token2); |
1051,7 → 1057,10 |
if (filterLineNumber == 28) { |
TCHAR* curFileNameOrig; |
TCHAR* curFileName; |
char n[5]; |
|
foundFilters++; |
|
curFileNameOrig = curFileName = (TCHAR*)malloc(MAX_PATH * sizeof(TCHAR)); |
|
strcpy_advance(&curFileName, sfr->sfFile.szName); |
1061,6 → 1070,12 |
xstrcat(curFileNameOrig, TEXT("__")); |
curFileName += strlen("__"); |
|
sprintf(n, "%04d", foundFilters); |
strcpy_advance_a(&curFileName, n); |
|
xstrcat(curFileNameOrig, TEXT("_")); |
curFileName += strlen("_"); |
|
strcpy_advance_a(&curFileName, tmp_cur_filter_str[0]); |
curFileName -= 4; // remove ".8bf" extension |
*curFileName = (TCHAR)0; |
1154,6 → 1169,7 |
|
free(q2); |
} |
} |
|
PIUNLOCKHANDLE(h); |
PIDISPOSEHANDLE(h); |