Note some null characters

This commit is contained in:
Clownacy 2020-04-07 14:03:15 +01:00
parent ae66ede214
commit 409453a6a1

View file

@ -139,7 +139,7 @@ BOOL LoadTextScript2(const char *name)
// Read data. Note that gTS.size may exceed the size of 'gTS.data' (TSC_BUFFER_SIZE) // Read data. Note that gTS.size may exceed the size of 'gTS.data' (TSC_BUFFER_SIZE)
fread(gTS.data, 1, gTS.size, fp); fread(gTS.data, 1, gTS.size, fp);
gTS.data[gTS.size] = 0; gTS.data[gTS.size] = '\0';
fclose(fp); fclose(fp);
// Set path // Set path
@ -173,7 +173,7 @@ BOOL LoadTextScript_Stage(const char *name)
// Read Head.tsc. Note that head_size may exceed the size of 'gTS.data' (TSC_BUFFER_SIZE) // Read Head.tsc. Note that head_size may exceed the size of 'gTS.data' (TSC_BUFFER_SIZE)
fread(gTS.data, 1, head_size, fp); fread(gTS.data, 1, head_size, fp);
EncryptionBinaryData2((unsigned char*)gTS.data, head_size); EncryptionBinaryData2((unsigned char*)gTS.data, head_size);
gTS.data[head_size] = 0; gTS.data[head_size] = '\0';
fclose(fp); fclose(fp);
// Open stage's .tsc // Open stage's .tsc
@ -190,7 +190,7 @@ BOOL LoadTextScript_Stage(const char *name)
// Read stage's tsc. Note that head_size + body_size may exceed the size of 'gTS.data' (TSC_BUFFER_SIZE) // Read stage's tsc. Note that head_size + body_size may exceed the size of 'gTS.data' (TSC_BUFFER_SIZE)
fread(&gTS.data[head_size], 1, body_size, fp); fread(&gTS.data[head_size], 1, body_size, fp);
EncryptionBinaryData2((unsigned char*)&gTS.data[head_size], body_size); EncryptionBinaryData2((unsigned char*)&gTS.data[head_size], body_size);
gTS.data[head_size + body_size] = 0; gTS.data[head_size + body_size] = '\0';
fclose(fp); fclose(fp);
// Set parameters // Set parameters