rewind: clear the error indicator

Make rewind() clear the error indicator of the stream
as it's specified by the standards.
This commit is contained in:
YAMAMOTO Takashi
2020-06-24 13:54:30 +09:00
committed by Xiang Xiao
parent d24bd782a9
commit ef5d204fd2
3 changed files with 56 additions and 3 deletions
+1 -1
View File
@@ -90,7 +90,6 @@
#define putchar(c) fputc(c, stdout)
#define getc(s) fgetc(s)
#define getchar() fgetc(stdin)
#define rewind(s) ((void)fseek((s),0,SEEK_SET))
/* Path to the directory where temporary files can be created */
@@ -168,6 +167,7 @@ ssize_t getdelim(FAR char **lineptr, size_t *n, int delimiter,
ssize_t getline(FAR char **lineptr, size_t *n, FAR FILE *stream);
FAR char *gets(FAR char *s);
FAR char *gets_s(FAR char *s, rsize_t n);
void rewind(FAR FILE *stream);
void setbuf(FAR FILE *stream, FAR char *buf);
int setvbuf(FAR FILE *stream, FAR char *buffer, int mode, size_t size);
int ungetc(int c, FAR FILE *stream);