Browse Source

Fix a bad assertion test.

Manuel Novoa III 24 years ago
parent
commit
1e26922dfc
1 changed files with 2 additions and 1 deletions
  1. 2 1
      libc/stdio/stdio.c

+ 2 - 1
libc/stdio/stdio.c

@@ -790,7 +790,8 @@ void _free_stdio_stream(FILE *fp)
 
 
 	/* Note: we generally won't bother checking for bad pointers here. */
 	/* Note: we generally won't bother checking for bad pointers here. */
 	if ((fp >= _stdio_streams) && (fp < _stdio_streams + FIXED_STREAMS)) {
 	if ((fp >= _stdio_streams) && (fp < _stdio_streams + FIXED_STREAMS)) {
-		assert( (fp - _stdio_streams) % sizeof(_stdio_streams[0]) == 0 );
+		assert( (fp - _stdio_streams) % ((_stdio_streams+1) -_stdio_streams)
+				== 0 );
 		fp->next = _free_file_list;
 		fp->next = _free_file_list;
 		_free_file_list = fp;
 		_free_file_list = fp;
 		return;
 		return;