Browse Source

fix signed overflow in ftok

Daniel Sabogal 7 years ago
parent
commit
511b7042b3
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/ipc/ftok.c

+ 1 - 1
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));
 }