mirror of
https://github.com/github/codeql.git
synced 2026-05-03 12:45:27 +02:00
Update cpp/ql/src/Likely Bugs/Arithmetic/IntMultToLong.cpp
Co-authored-by: Geoffrey White <40627776+geoffw0@users.noreply.github.com>
This commit is contained in:
@@ -5,4 +5,4 @@ long j = i * i; //Wrong: due to overflow on the multiplication between ints,
|
||||
long k = (long) i * i; //Correct: the multiplication is done on longs instead of ints,
|
||||
//and will not overflow
|
||||
|
||||
long k = static_cast<long>(i * i); //Correct: modern C++
|
||||
long l = static_cast<long>(i * i); //Correct: modern C++
|
||||
|
||||
Reference in New Issue
Block a user