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:
John Kessenich
2014-02-19 00:08:59 +00:00
parent 51cdd90fa8
commit 6494baf371
4 changed files with 11 additions and 12 deletions

View File

@@ -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) {