shithub: scc

Download patch

ref: 1fa53aab19efe6ccd1b521574a71fb6ce0e0f126
parent: 914b01afa8422ffa8ab9f125346502235e4d3163
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Mon Aug 20 08:46:59 EDT 2018

[lib/c] Fix precedence order in fopen.c

The lack of parentheses was making the evaluation wrong.

--- a/lib/c/fopen.c
+++ b/lib/c/fopen.c
@@ -12,7 +12,7 @@
 	FILE *fp;
 
 	for (fp = __iob; fp < &__iob[FOPEN_MAX]; ++fp) {
-		if (fp->flags & (_IOREAD | _IOWRITE | _IORW) == 0)
+		if ((fp->flags & (_IOREAD | _IOWRITE | _IORW)) == 0)
 			break;
 	}
 	if (fp == &__iob[FOPEN_MAX]) {