mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-28 08:12:28 +00:00
Get GNU GMP test suite fully passing
- Fix stdio fmemopen() buffer behaviors - Fix scanf() to return EOF when appropriate - Prefer fseek/ftell names over fseeko/ftello - Ensure locale field is always set in the TIB - Fix recent regression in vfprintf() return count - Make %n directive in scanf() have standard behavior
This commit is contained in:
parent
755ae64e73
commit
63a1636e1f
20 changed files with 228 additions and 51 deletions
|
@ -25,8 +25,6 @@
|
|||
#include "libc/sysv/errfuns.h"
|
||||
#include "libc/thread/thread.h"
|
||||
|
||||
// TODO(jart): POSIX says buffer needs to grow in write modes?
|
||||
|
||||
/**
|
||||
* Opens buffer as stream.
|
||||
*
|
||||
|
@ -63,7 +61,9 @@ FILE *fmemopen(void *buf, size_t size, const char *mode) {
|
|||
}
|
||||
f->fd = -1;
|
||||
f->buf = buf;
|
||||
f->end = size;
|
||||
if (!(iomode & O_TRUNC)) {
|
||||
f->end = size;
|
||||
}
|
||||
f->size = size;
|
||||
f->iomode = iomode;
|
||||
if (iomode & O_APPEND) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue