about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorDaniel Sabogal <dsabogalcc@gmail.com>2017-08-11 22:55:22 -0400
committerRich Felker <dalias@aerifal.cx>2017-08-12 09:09:27 -0400
commit511b7042b3844b42a940f1c31436fb04ce93ac19 (patch)
tree268986d3beda34eb2b26e260f0d69bc6c22ea7fe /src
parent1698fe6cdcdeaad03aa19a85433d5396ecfc51ef (diff)
downloadmusl-511b7042b3844b42a940f1c31436fb04ce93ac19.tar.gz
musl-511b7042b3844b42a940f1c31436fb04ce93ac19.tar.xz
musl-511b7042b3844b42a940f1c31436fb04ce93ac19.zip
fix signed overflow in ftok
Diffstat (limited to 'src')
-rw-r--r--src/ipc/ftok.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ipc/ftok.c b/src/ipc/ftok.c
index cd6002ed..c36b4b60 100644
--- a/src/ipc/ftok.c
+++ b/src/ipc/ftok.c
@@ -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));
 }