diff options
author | H. Peter Anvin <hpa@linux.intel.com> | 2012-05-12 13:19:33 -0700 |
---|---|---|
committer | H. Peter Anvin <hpa@linux.intel.com> | 2012-05-12 13:19:33 -0700 |
commit | 1a2cf5ff1da1fa7b24e0567afc2defb7f48a5db7 (patch) | |
tree | 909354c2eb99a7cf0d2fea46f8f6cc23f620a672 | |
parent | 36ee43a0ead72d8224aa1b66b07cac3b04329798 (diff) | |
download | klibc-1a2cf5ff1da1fa7b24e0567afc2defb7f48a5db7.tar.gz |
[klibc] fgets: shave a few bytes off
Shave a few bytes off the fgets() implementation.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
-rw-r--r-- | usr/klibc/fgets.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr/klibc/fgets.c b/usr/klibc/fgets.c index 4e9cf68945e97..cb4711afb6d16 100644 --- a/usr/klibc/fgets.c +++ b/usr/klibc/fgets.c @@ -16,8 +16,8 @@ char *fgets(char *s, int n, FILE *f) while (n > 1) { ch = getc(f); if (ch == EOF) { - *p = '\0'; - return NULL; + s = NULL; + break; } *p++ = ch; n--; |