communi / libcommuni

A cross-platform IRC framework for Qt
https://communi.github.io
BSD 3-Clause "New" or "Revised" License
83 stars 38 forks source link

'Multiplication result converted to larger type' warning #91

Closed vadi2 closed 3 years ago

vadi2 commented 3 years ago

We run CodeQL on our Mudlet repository, and we make use of this excellent library as well. CodeQL brings up a warning for https://github.com/Mudlet/Mudlet/blob/0aa3f1b568084bf0d451920686cfad09700281e1/3rdparty/communi/src/util/irclagtimer.cpp#L104-L104:

Multiplication result may overflow 'int' before it is converted to 'qint64'.

Rule explanation:

image

jpnurmi commented 3 years ago

Thanks! Feel free to push a quick fix as proposed by CodeQL, and we'll get it approved and merged right away. :)

jpnurmi commented 3 years ago

Fixed by #95