diff --git a/src/EnergyPlus/api/datatransfer.cc b/src/EnergyPlus/api/datatransfer.cc index fa6d83bdad3..ff98d413d0e 100644 --- a/src/EnergyPlus/api/datatransfer.cc +++ b/src/EnergyPlus/api/datatransfer.cc @@ -243,7 +243,7 @@ void resetErrorFlag(EnergyPlusState state) char *inputFilePath(EnergyPlusState state) { const auto *thisState = static_cast(state); - char *p = new char[std::strlen(thisState->dataStrGlobals->inputFilePath.c_str()) + 1]; + char *p = new char[std::strlen(thisState->dataStrGlobals->inputFilePath.string().c_str()) + 1]; std::strcpy(p, thisState->dataStrGlobals->inputFilePath.c_str()); return p; } diff --git a/tst/EnergyPlus/api/TestDataTransfer.c b/tst/EnergyPlus/api/TestDataTransfer.c index ccd767010b0..5544756772d 100644 --- a/tst/EnergyPlus/api/TestDataTransfer.c +++ b/tst/EnergyPlus/api/TestDataTransfer.c @@ -107,7 +107,7 @@ void afterZoneTimeStepHandler(EnergyPlusState state) exit(1); } - char * filePath = inputFilePath(state); + char *filePath = inputFilePath(state); printf("Input file path accessed via API: %s\n", filePath); free(filePath);