diff options
author | Ben Cheng <bccheng@android.com> | 2013-06-17 20:55:43 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2013-06-17 20:55:43 +0000 |
commit | 4381040f43c2d1887aea1c1ca8da8e75935db815 (patch) | |
tree | 164ad99da8278867da2e5e0d690269abb7bcfe87 | |
parent | cd7a9917db9ad4a4f56cca5153ea2a7b8fecfde9 (diff) | |
parent | edb0013923263b9bc2550e5cf02cf1494ba7660c (diff) | |
download | android_external_elfutils-4381040f43c2d1887aea1c1ca8da8e75935db815.tar.gz android_external_elfutils-4381040f43c2d1887aea1c1ca8da8e75935db815.tar.bz2 android_external_elfutils-4381040f43c2d1887aea1c1ca8da8e75935db815.zip |
Merge "Change getline to not count the null terminator"
-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; } |