chiark / gitweb /
random-util: always cast from smaller to bigger type when comparing
authorLennart Poettering <lennart@poettering.net>
Tue, 11 Jul 2017 08:35:47 +0000 (10:35 +0200)
committerSven Eden <yamakuzure@gmx.net>
Tue, 25 Jul 2017 07:48:11 +0000 (09:48 +0200)
commit9800a6ceb4801bb1f3e851b2244c84a8d8f116b1
treedddc9860f837b59041bce45f2fc6570a580b3ed6
parenta185a2fe0710e5ed943f7786119a3a0f4473b844
random-util: always cast from smaller to bigger type when comparing

When we compare two size values, let's make sure we cast from the
smaller to the bigger type first, if both types differ, rather than the
reverse in order to not run into overflows.
src/basic/random-util.c