fix signed overflow in ftok

This commit is contained in:
Daniel Sabogal 2017-08-11 22:55:22 -04:00 committed by Rich Felker
parent 1698fe6cdc
commit 511b7042b3

View File

@ -6,5 +6,5 @@ key_t ftok(const char *path, int id)
struct stat st;
if (stat(path, &st) < 0) return -1;
return ((st.st_ino & 0xffff) | ((st.st_dev & 0xff) << 16) | ((id & 0xff) << 24));
return ((st.st_ino & 0xffff) | ((st.st_dev & 0xff) << 16) | ((id & 0xffu) << 24));
}