Skip to content

Commit bfe3b29

Browse files
committed
fix integer overflow risk
1 parent d1b4fc2 commit bfe3b29

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

source/source_relax/bfgs.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ void BFGS::PrepareStep(std::vector<ModuleBase::Vector3<double>>& force,
128128
//! call dysev
129129
std::vector<double> omega(3*size);
130130
std::vector<double> work(3*size*3*size);
131-
int lwork=3*size*3*size;
131+
size_t lwork = (size_t)9 * size * size; //replace int with size_t
132132
int info=0;
133133
std::vector<double> H_flat;
134134

0 commit comments

Comments
 (0)