mirror of
https://github.com/python/cpython.git
synced 2025-09-27 02:39:58 +00:00
Reads of zero should be legal!
This commit is contained in:
parent
17e66f6d87
commit
dd5c7be568
1 changed files with 6 additions and 1 deletions
|
@ -1,5 +1,10 @@
|
||||||
/* File object implementation */
|
/* File object implementation */
|
||||||
|
|
||||||
|
/* XXX This should become a built-in module 'io'. It should support more
|
||||||
|
functionality, better exception handling for invalid calls, etc.
|
||||||
|
It should also cooperate with posix to support popen(), which should
|
||||||
|
share most code but have a special close function. */
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#include "PROTO.h"
|
#include "PROTO.h"
|
||||||
|
@ -142,7 +147,7 @@ fileread(f, args)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
n = getintvalue(args);
|
n = getintvalue(args);
|
||||||
if (n <= 0 /* || n > 0x7fff /*XXX*/ ) {
|
if (n < 0) {
|
||||||
errno = EDOM;
|
errno = EDOM;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue