Skip to content

Commit aa578ed

Browse files
vadi2geoffw0
andauthored
Update cpp/ql/src/Likely Bugs/Arithmetic/IntMultToLong.cpp
Co-authored-by: Geoffrey White <40627776+geoffw0@users.noreply.github.com>
1 parent f403c9d commit aa578ed

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cpp/ql/src/Likely Bugs/Arithmetic/IntMultToLong.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ long j = i * i; //Wrong: due to overflow on the multiplication between ints,
55
long k = (long) i * i; //Correct: the multiplication is done on longs instead of ints,
66
//and will not overflow
77

8-
long l = static_cast<long>(i * i); //Correct: modern C++
8+
long l = static_cast<long>(i) * i; //Correct: modern C++

0 commit comments

Comments
 (0)