summaryrefslogtreecommitdiff
path: root/mktag.c
diff options
context:
space:
mode:
authorCarlos Rica <jasampler@gmail.com>2007-07-18 18:31:03 (GMT)
committerJunio C Hamano <gitster@pobox.com>2007-07-19 00:30:03 (GMT)
commitc4fba0a358d43fdb2301dd122d68c49dd8471d71 (patch)
tree72c7d505f4a8e5da3514403ca379d4b51b55a355 /mktag.c
parent6fb73e442a7dc3e4b296b409a6f30145d85750e9 (diff)
downloadgit-c4fba0a358d43fdb2301dd122d68c49dd8471d71.zip
git-c4fba0a358d43fdb2301dd122d68c49dd8471d71.tar.gz
git-c4fba0a358d43fdb2301dd122d68c49dd8471d71.tar.bz2
Rename read_pipe() with read_fd() and make its buffer nul-terminated.
The new name is closer to the purpose of the function. A NUL-terminated buffer makes things easier when callers need that. Since the function returns only the memory written with data, almost always allocating more space than needed because final size is unknown, an extra NUL terminating the buffer is harmless. It is not included in the returned size, so the function remains working as before. Also, now the function allows the buffer passed to be NULL at first, and alloc_nr is now used for growing the buffer, instead size=*2. Signed-off-by: Carlos Rica <jasampler@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'mktag.c')
-rw-r--r--mktag.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mktag.c b/mktag.c
index b82e377..38acd5a 100644
--- a/mktag.c
+++ b/mktag.c
@@ -120,7 +120,7 @@ int main(int argc, char **argv)
setup_git_directory();
- if (read_pipe(0, &buffer, &size)) {
+ if (read_fd(0, &buffer, &size)) {
free(buffer);
die("could not read from stdin");
}