aboutsummaryrefslogtreecommitdiffstats
path: root/io.c
diff options
context:
space:
mode:
authorMartin Pool <mbp@samba.org>2002-03-22 05:14:44 +0000
committerMartin Pool <mbp@samba.org>2002-03-22 05:14:44 +0000
commit914cc65c9d751c6dd812e9cf8bd2d3169e288921 (patch)
tree780b0d82d8f2e2d82a1744a2412aaa1c2e7af9dd /io.c
parent6479c2ed3f08ee11929449d01e01c9b4c87b1314 (diff)
downloadandroid_external_rsync-914cc65c9d751c6dd812e9cf8bd2d3169e288921.tar.gz
android_external_rsync-914cc65c9d751c6dd812e9cf8bd2d3169e288921.tar.bz2
android_external_rsync-914cc65c9d751c6dd812e9cf8bd2d3169e288921.zip
Doc.
Diffstat (limited to 'io.c')
-rw-r--r--io.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/io.c b/io.c
index 1d406490..ed6a70c3 100644
--- a/io.c
+++ b/io.c
@@ -2,7 +2,7 @@
Copyright (C) 1996-2001 by Andrew Tridgell
Copyright (C) Paul Mackerras 1996
- Copyright (C) 2001 by Martin Pool <mbp@samba.org>
+ Copyright (C) 2001, 2002 by Martin Pool <mbp@samba.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -20,7 +20,6 @@
*/
/**
- *
* @file io.c
*
* Socket and pipe IO utilities used in rsync.
@@ -624,12 +623,19 @@ void write_byte(int f,unsigned char c)
+/**
+ * Read a line of up to @p maxlen characters into @p buf. Does not
+ * contain a trailing newline or carriage return.
+ *
+ * @return 1 for success; 0 for io error or truncation.
+ **/
int read_line(int f, char *buf, size_t maxlen)
{
while (maxlen) {
buf[0] = 0;
read_buf(f, buf, 1);
- if (buf[0] == 0) return 0;
+ if (buf[0] == 0)
+ return 0;
if (buf[0] == '\n') {
buf[0] = 0;
break;