Constructor for struct subInfo

This commit is contained in:
Martin Konrad
2019-01-04 13:53:07 -05:00
parent d8f18c27f4
commit 3e8b0028dc

View File

@@ -658,6 +658,8 @@ struct subInfo {
size_t size;
size_t curLength;
char *macroReplacements;
subInfo() : psubFile(nullptr), isFile(0), filename(nullptr), isPattern(0),
size(0), curLength(0), macroReplacements(nullptr) {};
};
static char *subGetNextLine(subFile *psubFile);
@@ -701,7 +703,7 @@ static void substituteDestruct(subInfo * const psubInfo)
ENTER;
freeSubFile(psubInfo);
freePattern(psubInfo);
free(psubInfo);
delete(psubInfo);
EXIT;
}
@@ -712,7 +714,7 @@ static void substituteOpen(subInfo **ppvt, char * const substitutionName)
FILE *fp;
ENTER;
psubInfo = static_cast<subInfo *>(calloc(1, sizeof(subInfo)));
psubInfo = new subInfo;
*ppvt = psubInfo;
psubFile = static_cast<subFile *>(calloc(1, sizeof(subFile)));
psubInfo->psubFile = psubFile;