diff options
author | Nathaniel Adkins <apexbios@gmail.com> | 2013-06-17 14:07:05 -0500 |
---|---|---|
committer | Nathaniel Adkins <apexbios@gmail.com> | 2013-06-17 15:45:51 -0500 |
commit | edb0013923263b9bc2550e5cf02cf1494ba7660c (patch) | |
tree | 164ad99da8278867da2e5e0d690269abb7bcfe87 | |
parent | cd7a9917db9ad4a4f56cca5153ea2a7b8fecfde9 (diff) | |
download | android_external_elfutils-edb0013923263b9bc2550e5cf02cf1494ba7660c.tar.gz android_external_elfutils-edb0013923263b9bc2550e5cf02cf1494ba7660c.tar.bz2 android_external_elfutils-edb0013923263b9bc2550e5cf02cf1494ba7660c.zip |
Change getline to not count the null terminator
See issue 56704
Change-Id: I22f563bc5f46b9806a5b69a9e9feea5def6527bd
-rw-r--r-- | bionic-fixup/getline.c | 4 | ||||
-rw-r--r-- | host-darwin-fixup/getline.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/bionic-fixup/getline.c b/bionic-fixup/getline.c index 041a5ed9..df07e81b 100644 --- a/bionic-fixup/getline.c +++ b/bionic-fixup/getline.c @@ -44,6 +44,6 @@ ssize_t getline(char **lineptr, size_t *n, FILE *stream) /* Write the NULL character */ (*lineptr)[len-1] = '\0'; - /* Return the length of the new buffer */ - return len; + /* Return the length of the new buffer not counting the null character */ + return len-1; } diff --git a/host-darwin-fixup/getline.c b/host-darwin-fixup/getline.c index 041a5ed9..df07e81b 100644 --- a/host-darwin-fixup/getline.c +++ b/host-darwin-fixup/getline.c @@ -44,6 +44,6 @@ ssize_t getline(char **lineptr, size_t *n, FILE *stream) /* Write the NULL character */ (*lineptr)[len-1] = '\0'; - /* Return the length of the new buffer */ - return len; + /* Return the length of the new buffer not counting the null character */ + return len-1; } |