Check-in a couple submitted char* string portability bug fixes: correct sizing of buffers and stop overwriting preprocessor token names with themselves.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@25402 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
@@ -224,7 +224,7 @@ void ProcessConfigFile()
|
||||
}
|
||||
|
||||
if (config == 0) {
|
||||
config = new char[strlen(DefaultConfig)];
|
||||
config = new char[strlen(DefaultConfig) + 1];
|
||||
strcpy(config, DefaultConfig);
|
||||
}
|
||||
|
||||
@@ -862,10 +862,10 @@ char** ReadFileData(const char* fileName)
|
||||
{
|
||||
FILE *in;
|
||||
int errorCode = fopen_s(&in, fileName, "r");
|
||||
char* fdata;
|
||||
char *fdata;
|
||||
int count = 0;
|
||||
const int maxSourceStrings = 5;
|
||||
char** return_data = (char**)malloc(maxSourceStrings+1);
|
||||
char** return_data = (char**)malloc(sizeof(char *) * (maxSourceStrings+1));
|
||||
|
||||
//return_data[MAX_SOURCE_STRINGS]=NULL;
|
||||
if (errorCode) {
|
||||
|
||||
Reference in New Issue
Block a user