summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2013-06-18 17:55:19 +0000
committerElliott Hughes <enh@google.com>2013-06-18 17:55:19 +0000
commitb6f4a7a95faa546c68aac2bdecae42c6f9120be0 (patch)
tree034af24412f8db212254129fe0bcd6699aa71dd4
parentedb0013923263b9bc2550e5cf02cf1494ba7660c (diff)
downloadandroid_external_elfutils-b6f4a7a95faa546c68aac2bdecae42c6f9120be0.tar.gz
android_external_elfutils-b6f4a7a95faa546c68aac2bdecae42c6f9120be0.tar.bz2
android_external_elfutils-b6f4a7a95faa546c68aac2bdecae42c6f9120be0.zip
Revert "Change getline to not count the null terminator"
This reverts commit edb0013923263b9bc2550e5cf02cf1494ba7660c. Change-Id: Ie66d0fac382a97a51912cd51f369842101881e44
-rw-r--r--bionic-fixup/getline.c4
-rw-r--r--host-darwin-fixup/getline.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/bionic-fixup/getline.c b/bionic-fixup/getline.c
index df07e81b..041a5ed9 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 not counting the null character */
- return len-1;
+ /* Return the length of the new buffer */
+ return len;
}
diff --git a/host-darwin-fixup/getline.c b/host-darwin-fixup/getline.c
index df07e81b..041a5ed9 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 not counting the null character */
- return len-1;
+ /* Return the length of the new buffer */
+ return len;
}