summaryrefslogtreecommitdiff
path: root/libc/stdio
diff options
context:
space:
mode:
authorJustin DeMartino <jjdemartino@google.com>2020-09-21 13:23:58 -0700
committerJustin DeMartino <jjdemartino@google.com>2020-09-21 13:23:58 -0700
commit7e4fe6a28b718ab97c08811566238af2893ca65b (patch)
tree5413a5ec890b5a1ac4fbbe4548b5014e41a2591b /libc/stdio
parentdcdcb3fa15004669823a3a118189d9d72ff30852 (diff)
parentab08b955a34423d53b28a6210e7530e67241af4a (diff)
Merge SP1A.200921.001
Change-Id: Id2ab019914bb555dadf52c46b8403c0d5fb3c20a
Diffstat (limited to 'libc/stdio')
-rw-r--r--libc/stdio/stdio.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/libc/stdio/stdio.cpp b/libc/stdio/stdio.cpp
index afc2c4881..b8aced83b 100644
--- a/libc/stdio/stdio.cpp
+++ b/libc/stdio/stdio.cpp
@@ -773,10 +773,7 @@ char* fgets(char* buf, int n, FILE* fp) {
// Returns first argument, or nullptr if no characters were read.
// Does not return nullptr if n == 1.
char* fgets_unlocked(char* buf, int n, FILE* fp) {
- if (n <= 0) {
- errno = EINVAL;
- return nullptr;
- }
+ if (n <= 0) __fortify_fatal("fgets: buffer size %d <= 0", n);
_SET_ORIENTATION(fp, -1);