mirror of
git://git.musl-libc.org/musl
synced 2025-01-24 23:53:45 +00:00
fix signed overflow in ftok
This commit is contained in:
parent
1698fe6cdc
commit
511b7042b3
@ -6,5 +6,5 @@ key_t ftok(const char *path, int id)
|
|||||||
struct stat st;
|
struct stat st;
|
||||||
if (stat(path, &st) < 0) return -1;
|
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));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user