summaryrefslogtreecommitdiff
path: root/src/stdio
diff options
context:
space:
mode:
Diffstat (limited to 'src/stdio')
-rw-r--r--src/stdio/getdelim.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/stdio/getdelim.c b/src/stdio/getdelim.c
index 26a56780..60c6cc18 100644
--- a/src/stdio/getdelim.c
+++ b/src/stdio/getdelim.c
@@ -15,6 +15,7 @@ ssize_t getdelim(char **restrict s, size_t *restrict n, int delim, FILE *restric
FLOCK(f);
if (!n || !s) {
+ f->mode |= f->mode-1;
f->flags |= F_ERR;
FUNLOCK(f);
errno = EINVAL;
@@ -58,6 +59,7 @@ ssize_t getdelim(char **restrict s, size_t *restrict n, int delim, FILE *restric
return i;
oom:
+ f->mode |= f->mode-1;
f->flags |= F_ERR;
FUNLOCK(f);
errno = ENOMEM;