提交 511b7042 编写于 作者: D Daniel Sabogal 提交者: Rich Felker

fix signed overflow in ftok

上级 1698fe6c
......@@ -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));
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册