Explorar o código

fix signed left-shift overflow in pthread_condattr_setpshared

Rich Felker %!s(int64=10) %!d(string=hai) anos
pai
achega
380857bf21
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/thread/pthread_condattr_setpshared.c

+ 1 - 1
src/thread/pthread_condattr_setpshared.c

@@ -4,6 +4,6 @@ int pthread_condattr_setpshared(pthread_condattr_t *a, int pshared)
 {
 	if (pshared > 1U) return EINVAL;
 	a->__attr &= 0x7fffffff;
-	a->__attr |= pshared<<31;
+	a->__attr |= (unsigned)pshared<<31;
 	return 0;
 }