summaryrefslogtreecommitdiff
path: root/src/ctype/tolower.c
diff options
context:
space:
mode:
authorJakob Kaivo <jkk@ung.org>2019-02-28 21:10:57 -0500
committerJakob Kaivo <jkk@ung.org>2019-02-28 21:10:57 -0500
commit08d8fd2767733d893380ebf5c8a4743dd371528d (patch)
treeb3aff9fe38cd3cd94d99ca51b76e3de0f34037f2 /src/ctype/tolower.c
parentb4409255ad7f446ad0a3386dc3669bbf270bb327 (diff)
fix ctype functions in the C/POSIX locale
Diffstat (limited to 'src/ctype/tolower.c')
-rw-r--r--src/ctype/tolower.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/ctype/tolower.c b/src/ctype/tolower.c
index 793de6bb..7ef5057a 100644
--- a/src/ctype/tolower.c
+++ b/src/ctype/tolower.c
@@ -1,4 +1,5 @@
#include <ctype.h>
+#include "stdio.h"
#include "limits.h"
#include "nonstd/assert.h"
#include "nonstd/ctype.h"
@@ -14,6 +15,10 @@ int tolower(int c)
RETURN_FAILURE(ARGUMENT(c), ARGUMENT(c) was not an uppercase letter or it has no equivalent lowercase letter);
*/
+ if (c == EOF) {
+ return EOF;
+ }
+
return map[c];
}