diff --git a/source/module_base/global_function.h b/source/module_base/global_function.h index 358454cc1d8..d52193d9123 100644 --- a/source/module_base/global_function.h +++ b/source/module_base/global_function.h @@ -147,7 +147,8 @@ template static void READ_VALUE(std::ifstream &ifs, T &v) { ifs >> v; - ifs.ignore(150, '\n'); + std::string line; + getline(ifs, line); return; } diff --git a/source/module_io/input.h b/source/module_io/input.h index b49cb97c040..ee9168bc183 100644 --- a/source/module_io/input.h +++ b/source/module_io/input.h @@ -575,7 +575,8 @@ class Input template static void read_value(std::ifstream &ifs, T &var) { ifs >> var; - ifs.ignore(150, '\n'); + std::string line; + getline(ifs, line); return; } void read_kspacing(std::ifstream &ifs)