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
..
2017-10-31 00:07:04 +00:00
2018-01-24 14:24:17 +00:00
2017-12-27 21:36:37 +00:00
2018-07-18 21:57:04 +00:00
2018-06-10 02:34:41 +00:00
2018-03-29 19:43:29 +00:00
2018-07-12 16:19:17 +00:00
2018-04-27 13:59:24 +00:00
2018-03-21 14:37:04 +00:00
2018-05-18 06:10:16 +00:00
2018-06-27 19:29:15 +00:00
2018-06-27 19:29:15 +00:00
2018-05-01 16:30:48 +00:00
2018-06-16 17:11:23 +00:00
2018-06-14 01:28:55 +00:00
2018-05-23 01:20:31 +00:00
2018-06-17 18:05:27 +00:00
2018-03-18 03:42:57 +00:00
2018-06-27 19:29:15 +00:00