fix undefined call order in fclose, possible lost output depending on compiler
[musl] / src / stdio / fclose.c
index 26bc37e..9481470 100644 (file)
@@ -13,7 +13,7 @@ int fclose(FILE *f)
                OFLUNLOCK();
        }
 
-       r = fflush(f) | f->close(f);
+       r = -(fflush(f) || f->close(f));
 
        if (!perm) free(f);