From b6f4a7a95faa546c68aac2bdecae42c6f9120be0 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Tue, 18 Jun 2013 17:55:19 +0000 Subject: Revert "Change getline to not count the null terminator" This reverts commit edb0013923263b9bc2550e5cf02cf1494ba7660c. Change-Id: Ie66d0fac382a97a51912cd51f369842101881e44 --- bionic-fixup/getline.c | 4 ++-- 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 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; } -- cgit v1.2.3