diff options
author | Ben Cheng <bccheng@android.com> | 2013-06-17 14:00:16 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2013-06-17 14:00:16 -0700 |
commit | e539949a5487c56cacf08a2cd42694606b9bf98e (patch) | |
tree | 164ad99da8278867da2e5e0d690269abb7bcfe87 | |
parent | ee5fb848d5f02a8d2c99cc1390001a7daedc4e66 (diff) | |
parent | 4381040f43c2d1887aea1c1ca8da8e75935db815 (diff) | |
download | android_external_elfutils-e539949a5487c56cacf08a2cd42694606b9bf98e.tar.gz android_external_elfutils-e539949a5487c56cacf08a2cd42694606b9bf98e.tar.bz2 android_external_elfutils-e539949a5487c56cacf08a2cd42694606b9bf98e.zip |
am 4381040f: Merge "Change getline to not count the null terminator"
* commit '4381040f43c2d1887aea1c1ca8da8e75935db815':
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; } |