Pedro F. Giffuni fee1489eb1 libc: fix cases of undefined behavior.
These were found by the Undefined Behavious  GsoC project at NetBSD:

Avoid undefined behavior in ftok(3)

Do not change the signedness bit with a left shift operation.
Cast to unsigned integer to prevent this.

ftok.c:56:10, left shift of 123456789 by 24 places cannot be represented
in type 'int'
ftok.c:56:10, left shift of 4160 by 24 places cannot be represented in
type 'int'

Avoid undefined behavior in an inet_addr.c

Do not change the signedness bit with a left shift operation.
Cast to unsigned integer to prevent this.

inet_addr.c:218:20, left shift of 131 by 24 places cannot be represented
in type 'int'

Detected with micro-UBSan in the user mode.

Obtained from:	NetBSD
MFC after:	2 weeks
2018-08-07 15:24:19 +00:00
..
2018-07-27 21:25:01 +00:00
2017-12-08 17:52:53 +00:00
2018-07-23 09:54:28 +00:00
2018-03-07 09:31:27 +00:00
2018-06-13 09:07:24 +00:00
2017-08-13 14:42:23 +00:00