simon-svn: utils: simon

Commits to Tartarus CVS repository. tartarus-commits at lists.tartarus.org
Thu May 15 23:21:38 BST 2014


SVN root:       svn://svn.tartarus.org/sgt
Changes by:     simon
Revision:       10191
Date:           2014-05-15 23:21:37 +0100 (Thu, 15 May 2014)

Log message (7 lines):
64-bit cleanness fix in the pidset implementation.

If we write '1 << n' and cast the result to an unsigned long, the 1 is
treated as a signed integer constant, so that shifting it left by 31
is undefined behaviour (and in this case can give 0xffffffff80000000
when the resulting signed thing is cast to unsigned long). Use 1UL
instead to ensure everything is the right type from the word go.

Modified files:
U   utils/pid/pid.c

Links:
http://svn.tartarus.org/sgt/?rev=10191&view=rev
http://svn.tartarus.org/sgt/utils/pid/pid.c?rev=10191&r1=10190&r2=10191



More information about the tartarus-commits mailing list