Merge "Change getline to not count the null terminator"
diff --git a/bionic-fixup/getline.c b/bionic-fixup/getline.c
index 041a5ed..df07e81 100644
--- a/bionic-fixup/getline.c
+++ b/bionic-fixup/getline.c
@@ -44,6 +44,6 @@
/* 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 041a5ed..df07e81 100644
--- a/host-darwin-fixup/getline.c
+++ b/host-darwin-fixup/getline.c
@@ -44,6 +44,6 @@
/* 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;
}