add space for null char in buffer in ICG main

This commit is contained in:
Scott Fennell 2020-02-11 10:41:09 -06:00
parent 27bfb42e94
commit 03bcbfa119

View File

@ -187,7 +187,7 @@ int main(int argc, char * argv[]) {
ci.createSema(clang::TU_Prefix, NULL); ci.createSema(clang::TU_Prefix, NULL);
// Get the full path of the file to be read // Get the full path of the file to be read
char buffer[input_file_names[0].size()]; char buffer[input_file_names[0].size() + 1];
strcpy(buffer, input_file_names[0].c_str()); strcpy(buffer, input_file_names[0].c_str());
std::string path(dirname(buffer)); std::string path(dirname(buffer));
path += "/"; path += "/";