stdlib.h
This commit is contained in:
parent
c6f1a399af
commit
3a3f6cc424
4 changed files with 262 additions and 11 deletions
|
@ -1683,7 +1683,8 @@ int _fopen_flags_from_mode(const char *mode) {
|
|||
}
|
||||
|
||||
FILE *_FILE_from_fd(int fd) {
|
||||
FILE *fp = calloc(1, sizeof(FILE));
|
||||
FILE *fp = malloc(sizeof(FILE));
|
||||
// NB: our malloc implementation returns zeroed memory
|
||||
fp->fd = fd;
|
||||
return fp;
|
||||
}
|
||||
|
@ -2274,7 +2275,9 @@ int scanf(const char *format, ...) {
|
|||
}
|
||||
|
||||
|
||||
void perror(const char *s); // @TODO
|
||||
void perror(const char *s) {
|
||||
printf("%s: %s\n", s, strerror(errno));
|
||||
}
|
||||
|
||||
#undef STB_SPRINTF_MIN
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue